home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac100% 1998 November
/
MAC100-1998-11.ISO.7z
/
MAC100-1998-11.ISO
/
オンラインソフト定点観測
/
ユーティリティ
/
Mops 3.2.sea
/
Mops 3.2
/
Quick Edit ƒ
/
Mops Glossary
next >
Wrap
Text File
|
1998-06-08
|
138KB
|
4,270 lines
! ( n addr -- )
Memory Nuc2.asm/pnuc1
Stores 32-bit n at address.
" ( -- addr len : <chars>" )
Lowstrings Nuc2.asm/zBase
At compile time, scans until " is encountered. At run time, pushes the
address and length of the enclosed string. E.g. " hi there" will, at
run time, push (addr len) for the string 'hi there'. May be used
outside a definition, with the proviso that the string will be stored
at HERE, which means that more than one " ..." on a line will give
unexpected results.
"STR" ( -- addr len )
Lowstrings Nuc2.asm/pnuc2
Scans for a string delimited by "..."
# ( ud1 -- ud2 )
NumericConversion Nuc2.asm/pnuc2
standard
#> ( n -- addr len )
NumericConversion Nuc2.asm/pnuc2
Ends numeric conversion. standard
#ALIGN ( n -- n' )
Compiler Nuc2.asm/pnuc3
Rounds n up to be a multiple of 4. Older synonym for #align4.
#ALIGN16 ( n -- n' )
Compiler Nuc2.asm/pnuc3
Rounds n up to be a multiple of 16.
#ALIGN2 ( n -- n' )
Compiler Nuc2.asm/pnuc3
Rounds n up to be a multiple of 2.
#ALIGN4 ( n -- n' )
Compiler Nuc2.asm/pnuc1
Rounds n up to be a multiple of 4.
#ALIGN8 ( n -- n' )
Compiler Nuc2.asm/pnuc3
Rounds n up to be a multiple of 8.
#OFF-ALIGN ( n -- n' )
Compiler pnuc3
(PowerMops only) Rounds n up to the 2-byte boundary between adjacent
4-byte boundaries.
#S ( |n| -- 0 )
NumericConversion Nuc2.asm/pnuc2
standard
#THREADS ( -- 8 )
Compiler Nuc2.asm/pnuc1
A constant.
#TIB ( -- n )
compiler Nuc2.asm/pnuc1
The number of characters in TIB.
$ ( -- n : ddd )
Compiler Base/zBase
Compiles the following characters in the input stream as a hex number.
$= ( addr1 len1 addr2 len2 -- result )
Strings String/pString
Compares string1 to string2, both given as the address of the first
byte (addr) and the number of bytes to compare (len). Essentially used
to do alphabetical sorts with a being less than b and so forth, but
note that a (ascii 97) still is "less than" B (ascii 66). Although A
will be less than a. Result = -1 if string1 is less than string2, = 0
if strings are equal, = 1 if string 1 is greater than string2.
Implemented with a Toolbox call to IUMagString. See IM for complete
detail. Also, see CMPSTR - it is faster.
& ( -- n : char )
Strings Base/zBase
Returns the ascii value of the next char in the input stream. Same as
ascii.
' ( -- xt : word )
Compiler Nuc2.asm
Looks up the dictionary for the next word in the input stream, and
returns the corresponding xt.
'TYPE ( -- 4bytestring : XXXX )
Resources Base/zBase
Given 4 ascii characters in the input stream, a 4bytestring will be
left on the stack. This data type is also known as a PACKED ARRAY[1..4]
OF CHAR; in Pascal.
( ( -- )
Compiler Nuc2.asm/pnuc2
Left paren. Denotes the beginning of a comment. At least one space must
follow. End comment with a right paren ).
(* ( -- )
Compiler Base/zBase
(* ... *) defines a multi-line comment, which can be nested.
(COL) ( -- : name )
OOP Struct/pStruct
A standard class. Collections are ordered lists with a current size. We
implement them by multiply inheriting the generic (COL) class with the
array class of the appropriate width. We use a few tricks to avoid late
binding to self in loops.
(COMP) ( xt -- )
Compiler Nuc2.asm/pnuc4
Compiles the word with the given xt. All compilation should be done via
this word or (COMPN), since fooling the code generator by bypassing it
probably isn't a good idea. This word assumes a zero opcode is to be
passed to the generator. If not, use (COMPN).
(COMPN) ( xt n -- )
Compiler Nuc2.asm/pnuc4
Is similar to (COMP), but has an additional parameter n which is the
opcode for -> ++> etc.
(EMIT) ( c -- )
Console Nuc2.asm/pnuc2
Prints a character on the screen only.
(FIND) ( string-addr lfa -- xt flag | -- string-addr false )
Compiler Nuc2.asm/pnuc4
The word that does the main work of looking up the dictionary for FIND.
lfa points to the CONTEXT entry where the search is to start.
(FINDM) ( hash class link-offs -- offs xt true | -- false )
OOPprimitive Nuc2.asm/pnuc4
The lowest-level primitive to search for a method or ivar, by going
through the linked list of methods/ivars looking for a match on the
given selector. Link-offs is the offset from the xt of the class, of
the first link in the search chain. The returned result offs is only
used for ivars, and relates to multiple inheritance. It is the offset
of the first of the ivars of the class in which the found ivar is
declared, within the actual class being searched.
(FORGET) ( lfa -- )
Compiler Nuc2.asm/pnuc3
Forgets down to the given lfa. For other comments, see FORGET.
(HEADER) ( -- )
Compiler Nuc2.asm
(68k only) Default for HEADER. Creates a dictionary header using the
next word in the input stream.
(KEY!) ( -- )
Events Event
(68k only) Sets the default action for vect key by storing the xt of
(key) in it.
(KEY) ( -- c )
Events Event
(68k only) The default action for key. c is the character corresponding
to the key that was pressed. : (key) key: fevent drop $ FF and ;
(PAUSE) ( -- )
Events Frontend/zFrontend
Our standard action for the vect pause.
(TYPE) ( addr len -- )
Console Nuc2.asm/pnuc2
Prints the given text to the screen.
) ( -- )
Compiler Base/zBase
Right paren. Denotes the end of a comment that was begun by ( .
* ( n1 n2 -- n1*n2 )
Arithmetic Nuc2.asm/pnuc1
Multiply.
*) ( -- )
Compiler Base/zBase
(* ... *) defines a multi-line comment, which can be nested.
** ( obj selid -- )
OOP Class/zClass
Late binds whatever is on the stack to the given method. e.g. obj get:
** . You must be sure that obj really does point to an object.
**N ( r n -- r**n )
FloatingPoint floating point
(68k Mops only) Integer exponentiation. Note this operation ignores the
high-order 16 bits of n.
*/ ( n1 n2 n3 -- (n1*n2)/n3 )
Arithmetic Nuc2.asm/pnuc1
Multiplies the two signed integers n1 and n2, then divides the double
number product by the signed number n3, leaving a signed quotient.
*/MOD ( n1 n2 n3 -- rem (n1*n2)/n3 )
Arithmetic Nuc2.asm/pnuc1
Same as */ except also leaves the remainder of the division.
*> ( f -- : word )
Arithmetic Args
(68k Mops only) A floating point prefix operator. Multiplies by f. Use
for fvalues, local fvariables, named input parameters. Not for ints.
*W ( n1 n2 -- n1*n2 )
Arithmetic Nuc2.asm/pnuc1
Faster than * on a 68000 if you know that the operands are in the range
-32768 to +32767. In PowerMops, this is the same as *.
+ ( n1 n2 -- n1+n2 )
Arithmetic Nuc2.asm/pnuc1
Add.
+! ( n addr -- )
Memory Nuc2.asm/pnuc1
Adds n to the longword at address.
++> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator, which adds n. Use for values and named parameters
and locals. Also works for floats.
+- ( n1 n2 -- n3 )
Arithmetic Nuc2.asm/pnuc1
Negates n1 if n2 is negative.
+> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator which adds n. Use for values and named parameters and
locals. Also works for floats.
+CURS ( -- )
Console Nuc2.asm/pnuc2
Turns on display of the cursor on the screen.
+ECHO ( -- )
Console Nuc2.asm/pnuc2
Turns on echoing to the screen of source files being loaded from disk.
You may want to use +echo when loading a newly created source file to
help spot any code snagging compilation. Echo is toggled by the
keyboard short cut: Command-O
+LOOP ( n -- )
ControlStructures Nuc2.asm/qpCond
Marks end of DO ...+LOOP structure. Like LOOP except will increment i
by n.
, ( n -- )
Compiler Nuc2.asm/pnuc3
Compiles 4-byte n into the next available dictionary.
, ( n -- )
Compiler Nuc2.asm/pnuc3
Stores n in the dictionary where DP points, and adds 4 to DP.
," ( -- )
Lowstrings Nuc2.asm/pnuc2
Add text till " to the dictionary.
,"STR" ( -- )
Lowstrings Nuc2.asm/pnuc2
Adds text delimited by " at the start and end.
,DLM-STR ( c -- )
Lowstrings Nuc2.asm/pnuc2
Scans the source for a string delimited at the start and end by c, then
adds it to the dictionary.
,EXEC ( xt n -- )
Compiler Args/zArgs
State-smart execute. If used within a program definition, compiles the
xt as a call to be executed at runtime; otherwise executes it
immediately. This is not an immediate word. It is useful in building
compiler words which conditionally compile other words.
,STR ( c -- )
Lowstrings Nuc2.asm/pnuc2
c is delimiter. Adds the following text until delimiter to the
dictionary as a counted string (in PowerMops, it goes to the data area).
- ( n1 n2 -- n1-n2 )
Arithmetic Nuc2.asm/pnuc1
Subtract.
-! ( n addr -- )
Memory Nuc2.asm/pnuc1
Subtracts n from the longword at address.
--> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator which subtracts n. Use for values and named
parameters and locals. Also works for floats.
-> ( n -- : word )
Memory Args/zArgs
Gazinta. A prefix operator. Stores n in values, named parameters and
locals and vects.
-CURS ( -- )
Console Nuc2.asm/pnuc2
Turns off display of the cursor on the screen.
-ECHO ( -- )
Console Nuc2.asm/pnuc2
Turns off echoing to the screen of source files being loaded from disk.
Echo is toggled by the keyboard short cut: Command-O
-MODELESS ( -- )
Events Objinit/zObjinit
Sets normal event handling - no modeless dialogs, by storing the
appropriate 23 event handlers in the event object fevent.
-ROT ( n2 n3 n1 -- n1 n2 n3 )
Stack Nuc2.asm/pnuc1
Reverse of rot. Also called DOWN.
. ( n -- )
Console Nuc2.asm/pnuc2
Displays a number, followed by one space.
." ( -- : <chars>" )
Lowstrings Nuc2.asm/pnuc2
Prints to the console text delimited by ".
.( ( -- )
Lowstrings Nuc2.asm/pnuc2
Prints out text till ). Immediate word.
.CLASS: ( -- )
OOP Class/zClass
A method. Prints the name of the class of the given object.
.CURS ( -- )
System Nuc2.asm/pnuc2
Draws the cursor in the Mops console window.
.ERR ( -- )
Errors Nuc2.asm/pnuc2
Displays the error info saved by SAVE_ERR. The value .stkLimit gives a
maximum of stack cells dumped -- this can be used to keep info from
scrolling off the screen. This word can be typed after an error to
repeat the last error dump but with all the data and return stack cells
dumped.
.H ( n -- )
Console Base/pnuc2
Displays number in hex.
.ID ( ?xt -- )
Compiler Nuc2.asm/pnuc4
If ?xt looks like an xt with a name, prints the name. If it looks like
a xt without a name, prints "(no name)". Otherwise doesn't print
anything.
.ID: ( -- )
OOP Class/zClass
A method. Prints the name of the given object, if it has a name.
.R ( n1 n2 -- )
Console Nuc2.asm/pnuc2
Prints n1 using the current number base, right-justified in a field n2
characters wide. The entire number is printed even if it exceeds field
width.
.RSTR ( -- : lit )
Errors Base/zBase
Displays given string number (a literal) from the mops.rsrc file,
preceded by "Msg# ..."
.S ( -- )
Stack Nuc2.asm/pnuc4
Non-destructively prints the contents of the two stacks in decimal and
hexadecimal. If words on the return stack look like return addresses or
object addresses, we print the appropriate name as well.
/ ( n1 n2 -- n1/n2 )
Arithmetic Nuc2.asm/pnuc1
Signed divide.
// ( -- : filename )
System Files/pFiles
Nesting loader. Usage: // filename
/> ( f -- : word )
Arithmetic Args
(68k Mops only) A floating point prefix operator. Divides by f. Use for
fvalues, local fvariables, named input parameters. Not for ints.
/MOD ( n1 n2 -- rem n1/n2 )
Arithmetic Nuc2.asm/pnuc1
Divides n1 by n2 leaving the remainder under the signed quotient.
/MODW ( n1 n2 -- rem n1/n2 )
Arithmetic Nuc2.asm
(68k only) Faster version of /mod on a 68000 if you know that the
operands are in the range -32768 to +32767.
/STRING ( addr len n -- addr' len' )
Lowstrings Nuc2.asm/pnuc2
Updates the string descriptor (addr len) by n bytes. Adds n to addr,
and subtracts it from len. n may be negative.
0, ( -- )
Compiler Base/zBase
Compiles an empty cell.
0< ( n -- b )
Arithmetic Nuc2.asm/pnuc1
less than zero
0<= ( n -- b )
Arithmetic Nuc2.asm/pnuc1
less than or equal to zero
0<> ( n -- b )
Arithmetic Nuc2.asm/pnuc1
not equal to zero
0= ( n -- b )
Arithmetic Nuc2.asm/pnuc1
equal to zero
0> ( n -- b )
Arithmetic Nuc2.asm/pnuc1
greater than zero
0>= ( n -- b )
Arithmetic Nuc2.asm/pnuc1
greater than or equal to zero
0DUP ( 0 -- 0 0 | n -- n )
Stack Nuc2.asm/pnuc1
Duplicates only if zero.
0EXIT ( ? -- )
ControlStructures Nuc2.asm/pnuc1
Equivalent to NIF EXIT THEN.
1+ ( n -- n+1 )
Arithmetic Base/zBase
1- ( n -- n-1 )
Arithmetic Base/zBase
1/F ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Floating reciprocal.
1/X ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Floating reciprocal.
16bits? ( n signed? -- n b )
Compiler Nuc2.asm/pnuc3
Returns true if n will fit in 16 bits (signed or unsigned as requested).
1CELL ( -- 4 )
Compiler Base/zBase
Returns the size of a cell in bytes. Currently always 4.
2* ( n -- 2*n )
arithmetic Base/pnuc1
2+ ( n -- n+2 )
Arithmetic Base/zBase
2- ( n -- n-2 )
Arithmetic Base/zBase
2/ ( n -- n/2 )
arithmetic Base/pnuc1
2DROP ( n1 n2 -- )
Stack Nuc2.asm/pnuc1
2DUP ( n1 n2 -- n1 n2 n1 n2 )
Stack Nuc2.asm/pnuc1
2SWAP ( n1 n2 n3 n4 -- n3 n4 n1 n2 )
Stack Nuc2.asm/pnuc1
Swaps the top two pairs of stack cells.
3+ ( n -- n+3 )
Arithmetic Base/zBase
3- ( n -- n-3 )
Arithmetic Base/zBase
4* ( n -- 4*n )
arithmetic Base/pnuc1
4+ ( n -- n+4 )
Arithmetic Base/zBase
4- ( n -- n-4 )
Arithmetic Base/zBase
4/ ( n -- n/4 )
arithmetic Base/pnuc1
: ( -- : name )
Compiler Nuc2.asm/cg5
Creates a dictionary entry for the next word in the input stream.
: NUM? ( addr len -- n true | -- n-lo n-hi true | -- false )
compiler Nuc2.asm/pnuc2
Attempts to convert the string ( addr len ) to a number. An initial
sign may be present. The value DPL is initially set to -1, and if a "."
appears in the string, DPL is set to the (zero-based) index of the "."
in the string. If the whole string is converted, the number and true is
returned, and if DPL was set non-negative, the number is returned as
double-length. If the string isn't all converted, we assume there is a
bad character in the number and return false.
:A ( -- : name )
Compiler Nuc2.asm/zBase
For defining action handlers that cross module bounds. If a class is
defined in module1, but instantiated in module2 with action handlers in
module2, define handlers with :a ... ;a.
:CLASS ( -- : name )
OOP Class/zClass
Begins definition of a new class. One or more classnames can be
designated as superclass(es). There are optional parameters that may
also be declared after the superclass list, including n INDEXED, LARGE,
and GENERAL.
:CODE ( -- : name )
Assembler
(68k Mops only) The analog of : for assembler definitions.
:F ( -- : name )
Compiler Base/qpCond
Begins compilation of a word which was previously forward-referenced.
:f creates a headerless entry for the word and then patches the
previous entry to point to the newly compiled definition.
Forward-referencing is useful when a word is to be used before it can
be defined. You end the compilation with ;f.
:LOC ( -- : name )
Compiler Args/zArgs
Commences the definition of the "main" word of a local section. The {
... } syntax is not used here, as it has already been done at LOCAL.
:M ( -- : name: )
OOP Class/zClass
Begins definition of a method within a class. Note that name: MUST end
with a colon (:).
:MCODE ( -- : name: )
Assembler
(68k Mops only) The analog of :m for assembler definitions.
:MLOC ( -- : name )
Memory Args
Commences the definition of the "main" method of a local section within
a class definition.
:NONAME ( -- xt 300 )
Compiler Base/cg5
Begins a colon definition with no name, and returns the xt of the
definition so that it can be called. The ANSI Standard defines the
stack effect as: (C: -- colon-sys ) (S: -- xt ) In Mops we implement
the control-flow stack on the data stack, which the Standard allows,
specifying that the control-flow stack items go above the data stack
items. In this word, "colon-sys" is just a security marker (300), so we
return this on top of the xt.
:PROC ( -- : name )
Toolbox Base
(68k Mops only) Begins compilation of a word that to the Toolbox
behaves like a Pascal procedure or function. You can use a :proc word
when a Toolbox routine requires a procedural argument. In PowerMops,
use :PPC_PROC
; ( -- )
Compiler Nuc2.asm/cg5
Ends a definition.
;A ( -- )
Compiler Nuc2.asm
For defining action handlers that cross module bounds. If a class is
defined in module1, but instantiated in module2 with action handlers in
module2, define handlers with :a ... ;a.
;CLASS ( -- )
OOP Class/zClass
Ends definition of a class.
;CODE ( -- )
Assembler
(68k Mops only) The analog of ; for assembler definitions.
;F ( -- )
Compiler Base/qpCond
Ends compilation of a word which was defined with :f. See forward.
;LOC ( -- )
Compiler Args/zArgs
Ends the definition of the "main" word, and ends the local section.
;M ( -- )
OOP Class/zClass
Ends definition of a method in a class.
;MCODE ( -- )
Assembler
(68k Mops only) The analog of ;m for assembler definitions.
;MLOC ( -- )
Memory Args
Ends the definition of the "main" method, and ends the local section.
;PROC ( -- )
Toolbox Base
(68k Mops only) Ends compilation of word defined with :proc
< ( n1 n2 -- b )
Arithmetic Nuc2.asm/pnuc1
Comparison operator - less than.
<" ( -- : filename )
Files Nuc2.asm
(68k Mops only) This is the primitive loader. Use this when rebuilding
Mops from below "Files" which contains the definition for //. Note that
-<" is a bit faster since the files are not echoed to display.
<# ( -- )
NumericConversion Nuc2.asm/pnuc2
Initializes numeric conversion. standard
<< ( n1 n2 -- n3 )
Arithmetic Nuc2.asm/pnuc1
Shifts n1 to the left by n2 bit positions. e.g. 3 2 << will yield 12
(0011) -> (1100).
<= ( n1 n2 -- b )
Arithmetic Nuc2.asm/pnuc1
less than or equal
<> ( n1 n2 -- b )
Arithmetic Nuc2.asm/pnuc1
not equal, perhaps we could use ュ ?
<BUILDS ( -- : name )
Compiler Nuc2.asm/qpCreate
We retain <BUILDS to be used in conjunction with DOES> rather than
following the standard and using CREATE. This is because CREATEd words
have the data right at the xt, while DOES> words have to have a pointer
to the DOES> code. So rather than waste space in CREATEd words or do a
complicated kludge during compilation, we use <BUILDS.
<findM> ( selID ^class -- xt offs xdispl-offs )
OOPprimitive Class/qpClass
Factored out from clFndm and objFindm. Finds a method's xt given a
selID and a class address, which has already been converted to a module
addr if necessary. offs will be nonzero if the method turns out to
belong to a superclass with a non-zero offset in the object - i.e. an
embedded object. If it's a large_obj_array, and the object is in the
indexed area, xdispl-offs will be nonzero. This allows the caller to
compile code to add the offset to the selected element.
= ( n1 n2 -- b )
Arithmetic Nuc2.asm/pnuc1
Comparison operator - equals.
> ( n1 n2 -- b )
Arithmetic Nuc2.asm/pnuc1
Comparison operator - greater than.
>= ( n1 n2 -- b )
Arithmetic Nuc2.asm/pnuc1
greater than or equal
>> ( n1 n2 -- n2 )
Arithmetic Nuc2.asm/pnuc1
Shifts n1 to the right by n2 bit positions. e.g. 12 2 >> will yield 3
(1100) -> (0011).
>BODY ( cfa/xt -- dfa )
compiler Nuc2.asm/pnuc1
Converts a code field address (same as an xt) to a data address. In
PowerMops it has to go to the data area. This isn't (and can't ever be)
standard, since these kinds of words don't have an 'xt' under the
standard. But in Mops, you can tick them, and use >BODY on the result
to get to the data.
>CLASS ( obj -- ^class | -- 0 )
OOPprimitive Nuc2.asm/pnuc4
Converts an object address to its class address. Returns zero if the
passed-in address isn't an object address. Needs to work for heap as
well as dictionary objects. The test is very unlikely (maybe 1/2**24)
to indicate a non-object as being an object. To save time we don't do a
conservative check on obj actually being a legal address (unlike
aligned_addr?), apart from checking that it is aligned, which is a very
quick check. This means we may crash if an aligned but illegal address
is passed in. The presumption is that it really is an object address,
and that anything else is an (unlikely) error.
>Classxt ( obj -- class | -- 0 )
Compiler Nuc2.asm/pnuc4
As for >CLASS, but if the class is exported from a module and you are
executing in the main dictionary, it gives the xt of the imported word,
without accessing the module. This can be useful if you just want to
identify a class without needing all the class info. If you are
executing in the module, however, you will get the xt of the class in
the module. The general rule is that the returned xt will always be the
same as if you had just ticked the classname, wherever you are
executing.
>FLOAT ( n -- r )
FloatingPoint Nuc2.asm
(68k Mops only) Converts the integer to a float.
>HDLR ( cfa/xt -- ^hndlr )
compiler Nuc2.asm/pnuc1
Converts a code field address (same as an xt) to a handler field
address.
>IN ( -- n )
compiler Nuc2.asm/pnuc1
The current offset into TIB.
>LINK ( cfa/xt -- lfa )
compiler Nuc2.asm/pnuc1
Converts a code field address (same as an xt) to a link field address.
>NAME ( xt -- nfa )
Compiler Nuc2.asm/pnuc1
Returns the name field address (nfa) for the given xt.
>NAME ( cfa/xt -- nfa )
compiler Nuc2.asm/pnuc1
Converts a code field address (same as an xt) to a name field address.
>NUMBER ( ud addr len -- ud' addr' len' )
compiler Nuc2.asm/pnuc2
Converts the characters within the string specified by ( addr len ) to
digits, and accumulates the result into a double number whose initial
value is ud. Conversion continues left-to-right until a non-convertible
character is encountered or the string is exhausted. The unconverted
part of the string is given by ( addr' len' ). If the whole string was
converted, addr' is the address of the first character past the end of
the string, and len' is zero. Characters "+" and "-" are taken as
unconvertible.
>OBJ ( xt -- addr )
OOPprimitive Class/qpClass
xt results from ticking an object, or the equivalent (ticking an object
isn't really legal). Returns the object's data address. On the 68k this
is just 8+, but in PowerMops we have to go from the code to the data
area.
>ORIGIN ( x y -- )
QuickDraw Nuc2.asm/pnuc2
Calls toolbox SetOrigin.
>PTR ( addr -- n )
Memory Nuc2.asm/pnuc1
An alias for @.
>R ( n -- )
ReturnStack Nuc2.asm/qpCond
Pushes the top stack value to the return stack.
>Str255 ( addr1 len addr2 -- addr2 )
Strings Base/pBase
Converts text beginning at addr1 for len characters to a str255 type
string at addr2.
?#xts ( n1 n2 -- )
Compiler Struct/pStruct
Used to check that the right number of stacked xts is being passed in.
?>CLASS ( obj -- class )
OOPprimitive Class/qpClass
Converts the pointer to an object to a pointer to its class. Gives an
error if not an object.
?>ClassInMod ( class -- class' )
Compiler Nuc2.asm/pnuc3
Converts a class address to the corresponding class address in a
module, if the class is exported, and holds the module. If the class
isn't exported, does nothing.
?CLASS ( -- )
OOPprimitive Class/qpClass
Error if not compiling a class definition.
?COMP ( -- )
Errors Nuc2.asm/pnuc3
Prints message: "compilation only" if not compiling, that is, if state
is not zero
?DEFN ( n1 n2 -- )
Errors Nuc2.asm/pnuc3
Prints message: "unpaired conditionals" if n1 does not equal n2.
Message indicates that compiled conditionals do not match, such as an
IF without a THEN.
?DO ( end beg -- )
ControlStructures Nuc2.asm/qpCond
Marks beginning of ?DO ... LOOP sequence. Will not execute even once if
end イ beg. See DO.
?DUP ( n -- n n | 0 -- 0 )
Stack Nuc2.asm/cg6
Duplicates only if non-zero.
?ERROR ( b -- : lit )
Errors Base/zBase
If b is true, aborts and displays given string number (a literal) from
the mops.rsrc file.
?EXEC ( -- )
Errors Nuc2.asm/pnuc3
Issues an error message if not in interpret state.
?EXIT ( ? -- )
ControlStructures Nuc2.asm/cg5
Equivalent to IF EXIT THEN.
?PAIRS ( n1 n2 -- )
Errors Nuc2.asm/pnuc3
Prints message: "unpaired conditionals" if n1 does not equal n2.
Message indicates that compiled conditionals do not match, such as an
IF without a THEN.
?PAUSE ( -- )
Events Nuc.asm/pnuc1
?RDEPTH ( -- )
Errors Base/zBase
Prints message: "Return Stack Overflow" and executes an abort if the
return stack is too close to its maximum depth.
?RTNAEPMISSED ( w:xx rc -- w:rc' )
Events Nuc2.asm
This can be called after calling GotParms? to convert the return code
from that word to the appropriate return code to return to the caller
of the handler. If GotParms? returns false, that means we missed a
parm, so we return -1715. If GotParms? returned anything non-zero, that
means we got all the parms, so we return zero.
?STACK ( -- )
Errors Nuc2.asm/pnuc3
Prints message: "empty stack" and executes an abort if underflow has
occurred on the parameter stack. Underflow may occur if a word or
method expects more parameters than are provided.
?TERMINAL ( -- b )
Events Nuc2.asm/pnuc2
Performs a 40 ?Event. Synonym for KEY?. Used in class Mouse, and in the
utility word ?pause to test for a keyboard event.
@ ( addr -- n )
Memory Nuc2.asm/pnuc1
Fetches 32-bit value at address.
@ABS ( addr -- abs-addr )
Compiler Nuc2.asm/setup
addr is the address of a relocatable address (i.e. where the
relocatable address itself is located, not where it points to). Fetches
this address and converts it to absolute. Gives an error if it isn't a
valid relocatable address.
@VAL ( -- )
Compiler Base/zBase
Compiles a number from input stream.
@WORD ( -- addr )
Compiler Base/zBase
Retrieves next blank-delimited word from input stream.
@XY ( -- x y )
QuickDraw Nuc2.asm/pnuc2
Via a toolbox call to GetPen, leaves the x and y coordinate of the
graphics pen.
a>> ( n1 n2 -- n2 )
arithmetic Nuc2.asm/pnuc1
Shifts n1 right by n2 bit positions, arithmetically (i.e. with sign
exdtension).
ABORT ( -- )
Errors Nuc2.asm/pnuc3
standard
ABORT" ( b -- : <string>" )
Errors Nuc2.asm/zBase
Prints the text string and executes an abort, if the boolean is true.
Useful in debugging and error reporting. Can only be used in a
definition.
ABORTVEC ( -- )
System Nuc.asm/pnuc1
A system vector. Contains cl3, defined in file Objinit.
ABOUTVEC ( -- )
Menus Frontend/zFrontend
The first action handler for our AppleMenu object, since it is a vect
we can reuse in an application.
ABS ( n -- |n| )
Arithmetic Nuc2.asm/pnuc1
Absolute value.
ABS> ( -- : word )
Arithmetic Args
(68k Mops only) A floating point prefix operator. Changes to absolute
value. Use for fvalues, local fvariables, named input parameters. Not
for ints.
ACCEPT ( addr cnt -- #chars )
Console Nuc2.asm/pnuc2
Transfers characters from the keyboard to memory starting at addr until
a return is received or cnt characters have been input. Returns the
number of characters read (not counting the final return, if any).
Characters are echoed to the primary and secondary devices by executing
the system vector echovec. When Mops starts up, echovec is vectored to
(emit), so that characters are echoed to the screen only.
ACTV-EVT ( -- false )
Events Event
An action word for fevent. Handles activate and deactivate events by
sending a late bound enable:and disable: messages to the current window
(but only if it is an application window).
ACTW ( -- wptr | 0 )
Events Window/pnuc1
A value. Indentifies any active Mops window which should be idled. Will
be set zero if we have, say, a dialog as the front window, but NOT if
we're switched into the background.
ADDR: ( -- ^base )
OOP Class/zClass
A method. Returns the address of the beginning of an object's ivars.
AEErrorVec ( -- )
Events Event
A vect. Called when an AppleEvent handler returns. Default is (AEerr).
AEhandler ( ^AE ^AEReply RefCon -- )
Events Nuc2.asm
Put at the start of an AppleEvent handler proc. Pops the parms into the
appropriate locations.
AGAIN ( -- )
ControlStructures Nuc2.asm/qpCond
Standard. Marks bounds of BEGIN ... AGAIN loop.
ALIGN ( -- )
Compiler Nuc2.asm/pnuc3
If the DP is odd, adds one to it.
ALIGN ( -- )
Compiler Nuc2.asm/pnuc3
Aligns DP to a 4-byte boundary. Any bytes skipped are cleared. Older
synonym for align4.
ALIGN-DP ( -- )
Compiler Nuc2.asm/pnuc3
Same as ALIGN.
ALIGN-DP ( -- )
Compiler Nuc2.asm/pnuc3
Aligns DP to a 4-byte boundary. Any bytes skipped are cleared. Older
synonym for align4.
ALIGN4 ( -- )
Compiler Nuc2.asm/pnuc3
Aligns DP to a 4-byte boundary. Any bytes skipped are cleared.
ALIGN8 ( -- )
Compiler Nuc2.asm/pnuc3
Aligns DP to an 8-byte boundary. Any bytes skipped are cleared.
ALIGNED ( addr -- even-addr )
Memory Nuc2.asm/pnuc3
Increments addr by one if it is odd, leaving the next address. You can
use align to make sure the 68000 will not try to access memory
beginning at an odd address, which can cause a fatal error.
ALIGNED ( n -- n' )
Compiler Nuc2.asm/pnuc3
Applies the default alignment to n - rounds it up to be a multiple of 2
on the 68k or 4 on the PowerPC. ANSI.
aligned_addr? ( ?addr -- ?addr b )
Compiler Nuc2.asm/pnuc4
Checks if ?addr could really be an aligned address. Used in stack
dumping when we don't know what a value is, but want to print a name if
there is one. We have to apply this check first so that we don't get an
address error.
ALIGNED_MOVE ( src dest cnt -- )
Memory Nuc2.asm/pnuc2
As for MOVE, but the source and destination areas must begin on 4-byte
aligned addresses, and the results are undefined if the areas overlap.
This gives better optimization possibilities.
ALLOT ( n -- )
Compiler Nuc2.asm/pnuc1
Allocates n bytes in the dictionary, by incrementing DP by n. In
PowerMops, the allocated bytes are in the data area.
AND ( n1 n2 -- n3 )
Logical Nuc2.asm/pnuc1
Bitwise AND.
AND> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator, which does a bitwise AND with n. Use for values and
named parameters and locals. Not for floats.
ANTILOG ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Antilog ( 10^x ) of x
AppleEvents? ( -- b )
Events Nuc2.asm/pnuc1
(68k Mopw) A value. Set True by the startup code if AppleEvents are
available. (PowerMops) Always returns True, as AppleEvents are always
available.
APPLEMEN ( -- obj )
Menus FrontEnd/zFrontend
The standard AppleMenu object. Need only send the getnew: message at
runtime to activate. Note you must copy the MENU resource #1 into an
installed application before this will run, otherwise bomb city.
APPLEMENU ( -- : name )
Menus MenuMod.txt
A standard class, subclass of menu. An applemenu facilitates standard
apple menu support by filling the menu with all of the desk accessories
when a getnew: message is sent. The Mops applemenu object is applemen.
APPWIND? ( -- b )
Events Event
True if this is an application window. This check is necessary for
non-multifinder systems while calling WaitNextEvent.
ARCTAN ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Computes arctangent, given radians.
ARRAY ( #elems -- : name )
OOP Struct/pStruct
A standard class. ARRAY is the basic 4-byte cell one-dimension array.
Class is INDEXED.
ARROWCURS ( -- )
Quickdraw QD
Sets the cursor to this. Merely calls Toolbox InitCursor.
ASYNCH ( -- )
Files Files/pFiles
Sets value asynch? to true.
ASYNCH? ( -- b )
Files Files/pFiles
A value. True if performing an asynchronous i/o operation.
BASE ( -- n )
Arithmetic Nuc2.asm/pnuc1
This value contains the current number base used for the input and
output conversions.
BE ( -- )
Compiler Base/zBase
A primitive for implementing become.
BECOME ( -- : word )
Events Base/zBase
BECOME allows restarting at a given word, with all stacks empty. This
is necessary in menu handlers and other areas that could create
indefinite nesting situations.
becomeXT ( -- : word )
Compiler Base/zBase
A system vect used to implement become.
BEEP ( dur -- )
Sound Nuc2.asm/setup
Beeps the Macintosh's speaker for dur ticks (60ths of a second).
BEGIN ( -- )
ControlStructures Nuc2.asm
standard. Marks the beginning of a BEGIN ...
(WHILE/NWHILE/UNTIL/NUNTIL/AGAIN) looping structure.
BIG# ( -- $7FFFFFFF )
System Nuc2.asm/pnuc1
A constant. The maximum positive number.
BIND_WITH ( obj --<selector> obj-modified xt )
OOP Class
(68k Mops only) If you are late-binding in a loop, it can be much
faster if you do the bind just once, then reuse the resulting xt each
time in the loop. This way you only have to perform the method search
once. To bind initially and get the xt, use BIND_WITH. Usage: (savext
and obj-mod are values or locals). (get object's address) bind_with
someSelector: -> savext -> obj-mod. (in the loop) obj-mod savext
ex-method.
BL ( -- 32 )
Strings Nuc2.asm/pnuc1
A constant.
BLANKS ( addr n -- )
LowStrings Nuc2.asm/pnuc2
Fills memory with blanks (ascii 32) starting at addr for n bytes.
BOOL ( -- : name )
OOP Struct/pStruct
A standard class. Subclass of byte. Note that since the datalength of
aMops class bool is 1, this class should not be used to map into a
Toolbox record of type BOOLEAN because the Pascal type boolean has a
length of 2 (Use the Mops class INT for a Toolbox boolean).
BOUNDS ( addr cnt -- limit addr )
Controlstructures Nuc2.asm/pnuc1
Equivalent to OVER + SWAP. Useful for setting up many DO loops.
BRESET ( addr bit# -- )
Memory Nuc2.asm
(68k only - now obsolete) Clears the bit. bit# can be >8.
BSET ( addr bit# -- )
Memory Nuc2.asm
(68k only - now obsolete) Sets the bit. bit# can be >8.
BTEST ( addr bit# -- b )
Memory Nuc2.asm
(68k only - now obsolete) Tests the bit and returns true if the bit is
set, false otherwise.
BTOGGLE ( addr bit# -- )
Memory Nuc2.asm
(68k only - now obsolete) Inverts the bit. bit# can be >8.
BUF255 ( -- addr )
Strings Base/setup
A 256-byte buffer for str255 operations.
BUSY ( -- n )
System Nuc2.asm
A value. FCB of file involved in asynchronous I/O, or zero if none. Set
from high level, not from here. Cleared here though, by the completion
routine.
BYE ( -- )
System Nuc2.asm/setup
Returns control to the Finder via ExitToShell.
BYTE ( -- : name )
OOP Struct/pStruct
A standard 1-byte variable class.
BYTES ( n -- : ivarname )
OOP Class/zClass
Bytes is used as the ivar allocation primitive for basic classes.
Allocates n bytes as a named instance variable of an object. You can
use bytes to map a Toolbox data structure as an object when named
access to some of the fields is not needed (but you must know the
proper length).
C! ( c addr -- )
Memory Nuc2.asm/pnuc1
Stores given 8-bit number to byte at given address.
C, ( w -- )
Compiler Nuc2.asm/pnuc3
Compiles 1-byte c into the next available dictionary.
C, ( c -- )
Compiler Nuc2.asm/pnuc3
Stores the byte c in the dictionary where DP points, and adds 1 to DP.
C@ ( addr -- u )
Memory Nuc2.asm/pnuc1
Fetches 8-bit value from given address, and zero-extends to 32 bits.
C@X ( addr -- n )
Memory Nuc2.asm/pnuc1
Fetches 8-bit value from given address, and sign-extends to 32 bits.
CALL ( -- : TrapName )
Toolbox tool.txt
(68k Mops only, and now obsolescent) Used to compile a call to a
Macintosh Toolbox routine. Simply follow call with the name of the
routine. Compilation only.
CallFirst ( -- : methodname: )
OOP Call1&Lmod.txt
The next method definition will always execute the method indicated by
methodname: BEFORE it is executed by a subclass. Provides a way for
superclasses to limit the extent to which subclasses may override a
method.
CallLast ( -- : methodname: )
OOP Call1&Lmod.txt
The next method definition will always execute the method indicated by
methodname: AFTER it is executed by a subclass. Provides a way for
superclasses to limit the extent to which subclasses may override a
method.
CASE ( -- )
ControlStructures Base/zBase
Begins a CASE .. OF .. ENDOF ... ENDCASE structure.
CASE? ( -- b )
Strings StrUtilities/zString
A value. True if case to be significant in comparisons done by CMPSTR
and string+ objects (does not affect string objects).
CASE_IN_NAMES? ( -- b )
compiler Nuc2.asm/pnuc1
Normally false. True if dictionary searches are to be case-sensitive.
CATCH ( xt -- n )
Errors Nuc2.asm/pnuc3
Standard Forth. Executes xt and returns 0 if all is OK, or n if THROW
was executed with n.
CATCH ( xt -- n )
Errors Nuc2.asm/pnuc3
EXECUTEs the xt. If the executed word does a THROW, n is the error code
passed to THROW. If it doesn't do a THROW, n is zero. If it does a
THROW, control doesn't return to CATCH, but to whoever called CATCH.
See the Standard for a full description.
CDP ( -- addr )
Compiler base/setup
(PowerMops) A value. The address of the next available memory location
in the code area.
CELL+ ( n -- n+4 )
Compiler Base/zBase
Adds the number of bytes in a cell to n. Currently in Mops this is
always 4.
CELL- ( n -- n-4 )
Compiler Base/zBase
Subracts the number of bytes in a cell from n. Currently in Mops this
is always 4.
CELLS ( #cells -- #bytes )
Compiler Base/zBase
Converts a cell count to a byte count.
CHAR ( -- n : char )
Strings Base/zBase
Returns the ascii value of the next char in the input stream.
CHAR+ ( n -- n+1 )
Compiler Base/zBase
Adds the number of bytes in a character (currently 1) to n.
CHARS ( n1 -- n2 )
Compiler Base/zBase
n2 is the number of bytes in n1 chars.ハハIn the current implementation
these are the same, so this word is effectively a no-op.
CHKCLASS ( xt -- xt )
OOPprimitive Class/qpClass
Gives an error if the xt does not refer to a class.
CHKSAME ( obj -- obj )
OOP Class/zClass
A check that two objects are of exactly the same class. Aborts with
error message if not.
CL>LEN ( #els class -- #els len )
OOPprimitive Class/qpClass
Gets data length of object given #els and class.
CLASS: ( -- class )
OOP Class/zClass
A method. Returns the class pointer for an object.
CLASS? ( ?xt -- ?xt b )
OOP Nuc2.asm/pnuc4
Returns true if ?xt is a class xt.
CLASSINIT: ( -- )
OOP Class/zClass
Our standard constructor method. The default message that is ALWAYS
sent to an object at time of instantiation, even ivars. Note that a
classinit: method should not expect any stack parameters (actually, it
will work for dictionary objects, but it won't work for ivars, so it is
best not to do this).
CLASS_IS ( -- : classname )
OOP Class/zClass
Used with object pointers. The object pointer syntax is ObjPtr ZZZ
class_is someClass Thereafter, any messages sent to zzz are early-bound
to the object that zzz points to at the time the message executes.
Also, see set_to_class .
ClFindM ( selID ^class -- xt offs xdispl-offs )
OOPprimitive Class/qpClass
Finds a method's xt given a selID and a class address. Results are as
for <findM>.
CloseResFile ( -- )
Resources Base/pBase
Closes the resource file last opened with OpenResFile.
CLS ( -- )
Console Nuc2.asm/pnuc2
Clears the current window and leaves cursor in upper left corner.
CMOVE ( src dest cnt -- )
Memory Nuc2.asm/pnuc2
Copies cnt bytes from src address to dest address, one byte at a time,
going from left to right. Cnt must be between 0 and 64K. Use move for a
more general cnt.
CMPSTR ( addr1 len1 addr2 len2 -- n )
Strings StrUtilities/zString
Compares 2 strings. Case is significant if CASE? is set to true.
Returns: -1 if first string low, 0 if strings are equal, 1 if first
string high. We assume the lengths are both less than 64K. Similar to
$=, but faster.
CODE ( -- : name )
Assembler Nuc2.asm
(68k Mops only) Creates a header for a code definition. In our system
it is actually a synonym for COLHDR, since there's really no essential
difference between code and colon definitions. In PowerMops, the
corresponding word is :PPC_CODE.
code, ( n -- )
Compiler pnuc3
(PowerMops only) Stores n in the dictionary where CDP points, and adds
4 to CDP.
codeC, ( c -- )
Compiler pnuc3
(PowerMops only) Stores the byte c in the dictionary where CDP points,
and adds 1 to CDP.
codeN, ( addr len -- )
Compiler pnuc3
(PowerMops only) Places the bytes designated by (addr len) in the
dictionary where CDP points, and adds len to CDP.
codeW, ( n -- )
Compiler pnuc3
(PowerMops only) Stores the low 16 bits of n in the dictionary where
CDP points, and adds 2 to CDP.
code_align ( -- )
Compiler pnuc3
(PowerMops only) Aligns CDP up to a 4-byte boundary. Any bytes skipped
are cleared.
code_allot ( n -- )
Compiler pnuc3
(PowerMops only) Allocates n bytes in the code are of the dictionary,
by incrementing CDP by n.
code_reserve ( n -- )
Compiler pnuc3
(PowerMops only) Allots the next n bytes in the code are of the
dictionary and erases them.
COLHDR ( -- )
Compiler Nuc2.asm/pnuc4
Lays down the header for a colon definition.
COMPILE, ( xt -- )
Compiler Nuc2.asm/pnuc4
Compiles the word with the given xt. ANSI synonym for (COMP) - see the
comments there.
CONSTANT ( n -- : name )
Memory Nuc2.asm/qpCreate
Creates a dictionary entry whose runtime action is to place n on the
stack.
CONTEXT ( -- addr )
Compiler Nuc.asm/setup
COPYTO: ( obj -- )
OOP Class/zClass
A method. Copies the ivar part of the passed in object to self. Doesn't
check type - be careful.
COS ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Computes cosine, given radians.
COT ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Computes cotangent, given radians.
COUNT ( addr -- addr+1 len )
Strings Nuc2.asm/pnuc1
Converts a Pascal type string (str255) to the addr len format.
CR ( -- )
Console Nuc2.asm/pnuc2
"Prints" a carriage-return/linefeed (cr/lf) on the screen. If system
vector pcrvec is vectored to pcr, by executing +print, the cr sends a
cr/lf to the printer.
CREATE ( -- : name )
Compiler Nuc2.asm/qpCreate
Creates a definition for name. DP is aligned, but no extra space is
allocated. When name is executed, it returns the aligned DP value.
CREPLACE ( c mask addr -- )
Memory Nuc2.asm/pnuc1
Replaces bits in the addressed byte with the corresponding bits from c,
in those positions where the mask has ones. Dont' use. Use bset, etc.
CRESET ( c addr -- )
Memory Nuc2.asm/pnuc1
Clears bits in byte at addr, corresponding to the bits SET in c.
CROSSCURS ( -- )
Quickdraw QD
Sets the cursor to this.
CRVEC ( -- )
System Nuc2.asm
(68k Mops only) A system vector which is called when we send a carriage
return to the Mops window. In PowerMops we haven't implemented this
vector as it hasn't proved very useful.
CSET ( c addr -- )
Memory Nuc2.asm/pnuc1
ORs c into the byte at addr.
CSTATE ( -- b )
Compiler Nuc2.asm/pnuc1
This value is a boolean which is true while a class is being compiled.
It is analogous to state which is true while a colon word is being
compiled.
CTOGGLE ( c addr -- )
Memory Nuc2.asm/pnuc1
Exclusive-ORs c into the byte at addr.
CURR-DEF ( -- addr )
compiler pnuc1
(PowerMops only) The address of the start of the code of the current
definition.
curs? ( -- b )
system Nuc2.asm/pnuc1
True if we're displaying a cursor after each output character.
CURSOR ( n -- : name )
Quickdraw QD
A defining word for cursors, uses the Toolbox calls GetCursor and
SetCursor at runtime execution of daughter words.
CvtClip ( -- )
Events Event
A vect. Called for clip conversion.
D+ ( d1 d2 -- d1+d2 )
arithmetic longmath/pnuc1
Double add.
D- ( d1 d2 -- d1-d2 )
arithmetic longmath/pnuc1
Double subtract.
DATETIME ( -- n )
Time Base/zBase
Returns the value of the Mac global variable Time on the stack. This is
the number of seconds since midnight, January 1, 1904.
DB ( -- )
Debugging Nuc2.asm/cg6
Calls MacsBug or whatever debugger may be installed (A9FF trap).
DBLTICKS ( -- n )
Events Event
Returns the double-click interval in ticks via the Mac global variable
DoubleTime.
DECIMAL ( -- )
NumericConversion Nuc2.asm/pnuc1
Sets base to 10.
DEFINED? ( -- addr n : word )
Compiler Nuc2.asm/pnuc4
Defined as MWORD FIND. Does a FIND on the next word in the input stream.
DEG2RAD ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Converts degrees to radians.
DEL ( -- )
System QD
Draws a downward-pointing arrow to the right of and below the current
pen position - we need this for pop-up menus. Any mathematician will
recognize this symbol - hence the name.
DEPTH ( -- n )
Stack Nuc2.asm/pnuc1
Returns the number of items on the stack prior to executing depth.
DESK ( -- )
Events Event
Desktop click handler - do nothing.
DFA ( class -- dfa )
OOPprimitive Class/qpClass
Given a pointer to a class, returns the data field address. First 2
bytes are the data length, second 2 bytes are the width of the indexed
elements.
DIALOG ( -- : name )
Alerts/Dialogs DialogMod.txt
A standard class, subclass of x-array. The Mops approach to handling
dialogs.
DICADDR ( -- : name )
OOP Struct/pStruct
DICADDR is a relocatable dictionary address class - use to store
non-executable dictionary addresses.
DICSIZE ( -- n )
Compiler Nuc2.asm/setup
A value. Set by the startup code to the actual space allocated for the
dictionary
DIE ( strID -- )
Errors Nuc.asm/pnuc3
(68k) A system vector, normally pointing to (die), defined in file
Base. (PowerMops) a forward definition, resolved in pnuc3. The default
Mops error word. Displays the given mops.rsrc string, dumps the stacks
and aborts.
DIGIT ( c base -- n2 t | f )
Arithmetic Nuc2.asm/pnuc1
Converts the ASCII character c using base into its binary equivalent
n2, and leaves a true flag; if conversion fails, leaves a false flag
only. Digit is a primitive used by (number).
DISK-EVT ( -- false )
Events Event
An action word for fevent. Handles a disk insert event.
DISPL! ( addr addr2 -- )
Compiler Nuc2.asm/pnuc3
Stores addr1 as a 4-byte self-relative displacement at addr2. The
converse of DISPLACE.
DISPL, ( addr -- )
Compiler Nuc2.asm/pnuc3
Stores addr as a 4-byte self-relative displacement at HERE, and
advances DP by 4.
DISPL, ( addr -- )
Compiler Nuc2.asm/pnuc3
Stores addr as a 4-byte self-relative displacement at DP, and adds 4 to
DP.
DISPLACE ( addr -- addr' )
Compiler Nuc2.asm/pnuc3
Takes the 4-byte value at addr as a self-relative displacement, and
returns the resulting address (obtained by adding the value to addr).
But if addr is zero, DISPLACE returns zero. This feature is useful for
finding the end of a chained list.
DisplCode, ( addr -- )
Compiler pnuc3
(PowerMops only) Stores addr as a 4-byte self-relative displacement in
the code area of the dictionary where CDP points, and advances CDP by 4.
DLEN ( obj -- n )
OOPprimitive Class/qpClass
Given a class pointer, returns the ivar data length.
DLEN&XWID ( class -- dlen xwid )
OOPprimitive Class/qpClass
Given a class pointer, retuns the ivar data length and width of the
indexed elements.
DLGWIND ( -- 1 )
Windows Window
A constant.
DNEGATE ( d -- -d )
arithmetic longmath/pnuc1
Negates a double number.
DO ( end beg -- )
ControlStructures Nuc2.asm/qpCond
Marks beginning of DO ... LOOP sequence. Will always execute at least
once, even if end イ beg. Also see ?DO. The loop is considered to be
finished if the index crosses the boundary between the limit and the
limit minus one, in either direction.
doAEhandler ( ^AE ^AEReply RefCon -- )
Events Nuc1.asm
Called from AEhandler to set things up at the start of a handler.
DOCWIND ( -- 0 )
Windows Window
A constant.
DODSK ( item# -- item# )
Menus Menu
Executes the desk accessory for an item. Mops will use this as the
second action handler for the object applemen.
DOES> ( -- )
Compiler Nuc2.asm/qpCreate
Defines the runtime action of a word defined with <builds.
DOWN ( n2 n3 n1 -- n1 n2 n3 )
Stack Nuc2.asm/pnuc1
Reverse of rot. Also called -ROT.
DP ( -- addr )
Compiler Nuc.asm/pnuc1
A value. The address of the next available memory location in the
dictionary, or in PowerMops, the address of the next available location
in the data area.
DPL ( -- n )
Console Nuc2.asm/pnuc1
Returns the number of digits to the right of the decimal on double
integer input. This may be used to compute the output column location
of a decimal point in user generated formatting. The default value on
single number inputs is -1.
DROP ( n -- )
Stack Nuc2.asm/pnuc1
DUMP ( addr len -- )
Memory Struct/pStruct
Displays the contents of memory beginning at addr for len bytes in a
hex and ascii format. Note that the ¥/ mark points to the requested
address (the dump may start at an address other than addr).
DUMP: ( -- )
OOP Class/zClass
A method. Performs a formatted dump of a class.
DUP ( n -- n n )
Stack Nuc2.asm/pnuc1
E ( -- r )
FloatingPoint floating point
(68k Mops only) An fcon. Returns the base of the system of natural
logarithms, 2.71828...
E. ( r -- )
PowerMops: ( -- ) ( F: r -- )
FloatingPoint floating point/zFloating point
Same as 26 e.r
E.R ( r wid -- )
PowerMops: ( wid -- ) ( F: r -- )
FloatingPoint floating point/zFloating point
Prints the floating point number in scientific notation in a field wid
characters wide.
ECHO? ( -- b )
Console Base/pnuc1
A value. Set true to echo loads to screen.
ECHOVEC ( -- )
Console Nuc2.asm/pnuc2
This system vector is executed in Mops to echo keystrokes. When Mops
starts up, echovec is vectored to (emit) which prints a character on
the screen only. Selecting Echo to Printer from the Mops menu vectors
echovec to echo, which prints a character on the screen and printer
(this is the same as +print).
EDITMENU ( -- : name )
Menus MenuMod.txt
A standard class, subclass of menu. An editmenu facilitates standard
desk accessory support by first calling SystemEdit when an exec:
message is sent so that any active DA first gets a go at it. The Mops
editmenu object is editmen.
ELSE ( -- )
ControlStructures Nuc2.asm/qpCond
standard. Use with IF and NIF.
EMIT ( c -- )
Console Nuc2.asm/pnuc2
Prints the character (lower 8 bits of the number) on the stack to the
screen or printer by executing the system vectors emitvec and pemitvec.
Whether the screen and/or printer are used depends on the contents of
emitvec and pemitvec. When Mops starts up, emitvec is vectored to
(emit) and pemitvec is vectored to drop. So, the default action of emit
is to print a character on the screen only. Selecting Echo to Printer
from the Mops menu vectors echovec to echo, which prints a character on
the screen and the printer (this is the same as +print). The system
value OUT is incremented for each character transmitted.
emit? ( -- b )
Compiler Nuc2.asm/setup
A value. True if EMIT is actually to emit anything.
EMITVEC ( -- )
Console Nuc2.asm/pnuc2
This system vector contains the xt of the word that performs character
output to the primary device, usually the screen. When Mops starts up,
emitvec is vectored to (emit), the primitive that prints a character on
the screen using the DrawChar routine in QuickDraw.
ENDCASE ( n -- )
ControlStructures Base/zBase
Marks end of CASE structure.
ENDLIST? ( chr -- b )
Compiler Base/zBase
Primitive used by type{.
ENDOF ( -- )
ControlStructures Base/zBase
Use in CASE structure.
ENUM{ ( -- : name1 name2 etc. )
Compiler Base/zBase
Synonym for ENUM{. Defines an enumerated type. The first name in the
list will be defined as a constant of value 0, the second will get
value 1, and so on.
EOF ( -- -39 )
Files Files/pFiles
A constant. Mac File Manager result code eofErr. Logical end-of-file
reached during read operation.
ERASE ( addr n -- )
LowStrings Nuc2.asm/pnuc2
Clears (fills with zeros) memory starting at addr for n bytes.
ERRORVEC ( -- )
System Nuc.asm/pnuc1
A system vector. Allows an application to handle an error before the
normal Mops error handling gets a chance.
EVALUATE ( addr len -- )
Compiler Args/pArgs
Makes the passed-in string the input stream for interpretation or
compilation, until it is exhausted.
EVENT ( -- : name )
Events Event
A system class, subclass of x-array. Our Mops event object is fevent.
EVENT? ( eventMask -- b )
Events Nuc2.asm/pnuc2
Calls the Toolbox Event Manager routine EventAvail to test for the
event(s) specified by eventMask. If an event is available, leaves a
true flag; otherwise, leaves a false flag.
EVENTLOOP ( -- )
Events Frontend/zFrontend
A word you can call as an event loop in many applications.
EX-GEN ( xt -- )
Compiler Nuc2.asm/cg7
"Execute general". Executes the word with the given xt. The word may be
anything. It is executed by compiling it into a temporary buffer, then
branching there. Slower than Execute, but unlike Execute, will really
execute anything.
EX-METHOD ( obj xt -- )
OOP Nuc2.asm/qpClass
Executes the method with the given xt, using the given object.
EXECUTE ( xt -- )
Compiler Nuc2.asm/setup
Standard. Executes the word with the given xt.
EXIT ( -- )
ControlStructures Nuc2.asm/qpCond
Terminates execution of the current word or method, and returns control
to the next higher word on the return stack.
EXN ( xt n -- )
Compiler Nuc2.asm/cg7
is to EX-GEN what (COMPN) is to (COMP). It has the additional parameter
n which is action code for -> ++> etc. Because this can be called from
EX-GEN (which may be executing a prefix op), we use the alternate
execution buffer ExBuf1.
EXP ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Base e exponential. In PowerMops, use FEXP.
EXP1 ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) e**x - 1
EXP21 ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) 2**x - 1
EXTEND ( n1 -- n2 )
Arithmetic Nuc2.asm/pnuc1
Takes the low 16 bits of n1 as a 16-bit number, and sign-extends it to
32 bits. Stack alignment is unaffected.
extraFind ( -- )
compiler Nuc2.asm/pnuc1
A dynamic vector. If non-zero, called by FIND so we can include a
special purpose search when necessary.
extra_inits ( -- )
FrontEnd Struct/pnuc1
Executes all of the xts contained in the object init_actions - this
allows an application to add any special initialization it wants.
F! ( r addr -- )
PowerMops: ( addr -- ) ( F: r -- )
FloatingPoint pnuc1
floating point/pnuc1 Stores the floating point number r at addr.
F* ( r1 r2 -- r1*r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r1*r2 )
FloatingPoint floating point/pnuc1
Floating multiply.
F** ( r1 r2 -- r1**r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r1**r2 )
FloatingPoint floating point
General exponentiation - takes 2 floats.
F**2 ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Floating square. Equivalent to fdup f*.
F+ ( r1 r2 -- r1+r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r1+r2 )
FloatingPoint floating point/pnuc1
Floating add.
F- ( r1 r2 -- r1-r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r1-r2 )
FloatingPoint floating point/pnuc1
Floating subtract.
F.R ( r wid -- )
PowerMops: ( wid -- ) ( F: r -- )
FloatingPoint floating point/zFloating point
Prints the floating point number without exponents in a field wid
characters wide.
F/ ( r1 r2 -- r1/r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r1/r2 )
FloatingPoint floating point/pnuc1
Floating divide.
F0< ( r -- b )
PowerMops: ( -- b ) ( F: r -- )
FloatingPoint floating point/pnuc1
F0<= ( r -- b )
PowerMops: ( -- b ) ( F: r -- )
FloatingPoint floating point/pnuc1
F0<> ( r -- b )
PowerMops: ( -- b ) ( F: r -- )
FloatingPoint floating point/pnuc1
F0= ( r -- b )
PowerMops: ( -- b ) ( F: r -- )
FloatingPoint floating point/pnuc1
F0> ( r -- b )
PowerMops: ( -- b ) ( F: r -- )
FloatingPoint floating point/pnuc1
F0>= ( r -- b )
PowerMops: ( -- b ) ( F: r -- )
FloatingPoint floating point/pnuc1
F2DROP ( r1 r2 -- )
PowerMops: ( -- ) ( F: r1 r2 -- )
FloatingPoint floating point/pnuc1
F2DUP ( r1 r2 -- r1 r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r1 r2 )
FloatingPoint floating point/pnuc1
F2SWAP ( r1 r2 r3 r4 -- r3 r3 r1 r2 )
PowerMops: ( -- ) ( F: r1 r2 r3 r4 -- r3 r3 r1 r2 )
FloatingPoint floating point/pnuc1
F< ( r1 r2 -- b )
PowerMops: ( -- b ) ( F: r1 r2 -- )
FloatingPoint floating point/pnuc1
F<= ( r1 r2 -- b )
PowerMops: ( -- b ) ( F: r1 r2 -- )
FloatingPoint floating point/pnuc1
F<> ( r1 r2 -- b )
PowerMops: ( -- b ) ( F: r1 r2 -- )
FloatingPoint floating point/pnuc1
F= ( r1 r2 -- b )
PowerMops: ( -- b ) ( F: r1 r2 -- )
FloatingPoint floating point/pnuc1
F> ( r1 r2 -- b )
PowerMops: ( -- b ) ( F: r1 r2 -- )
FloatingPoint floating point/pnuc1
F>= ( r1 r2 -- b )
PowerMops: ( -- b ) ( F: r1 r2 -- )
FloatingPoint floating point/pnuc1
F@ ( addr -- r )
PowerMops: ( addr -- ) ( F: -- r )
FloatingPoint floating point/pnuc1
Fetches the floating point number at addr. In PowerMops, it is fetched
to the floating point stack.
FABS ( r -- |r| )
PowerMops: ( -- ) ( F: r -- |r| )
FloatingPoint floating point/pnuc1
Floating absolute value.
FACOS ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP acos.
FACOSH ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP acosh.
fAE ( -- ^AE )
events Nuc.asm
A value used to handle AppleEents.
FALSE ( -- b )
Arithmetic Nuc2.asm/setup
A constant = 0
FASIN ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP asin.
FASINH ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP asinh.
FATAN ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP atan.
FATAN2 ( PPC/ ( -- ) ( F: r1 r2 -- r3 ) )
FloatingPoint zFloating point
(PowerMops only) r3 is the radian angle whose tangent is r1/r2. An
ambiguous condition exists if r1 and r2 are zero.
FATANH ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP atanh.
FCON ( r -- : name )
FloatingPoint Nuc2.asm
(68k Mops only - in PowerMops the name is FCONSTANT) FP analog of
constant.
FCONSTANT ( r -- : name )
PowerMops: ( -- ) ( F: r -- )
FloatingPoint qpCreate
FP analog of constant.
FCONV? ( addr len -- r T | -- F )
FloatingPoint floating point
(68k Mops only) Converts the passed-in ASCII string to floating, if
possible. I like this name better than ATOF which Neon had, but change
it back if you want to.
FCOS ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP cosine.
FCOSH ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP cosh.
FDEPTH ( -- n )
Stack pnuc1
PowerMops only. Returns the number of items on the floating point stack
prior to executing depth.
FDOWN ( r1 r2 r3 -- r3 r1 r2 )
PowerMops: ( -- ) ( F: r1 r2 r3 -- r3 r1 r2 )
FloatingPoint floating point/pnuc1
FDROP ( r -- )
PowerMops: ( -- ) ( F: r -- )
FloatingPoint floating point/pnuc1
FDUP ( r -- r r )
PowerMops: ( -- ) ( F: r -- r r )
FloatingPoint floating point/pnuc1
fence ( -- addr )
Compiler Nuc.asm/pnuc1
A value. Leaves the address below which forget will not operate.
fEvent ( -- obj )
Events Event/setup
The standard Mops event object. This event is the default (and should
be the only) Event object used by Mops. Actually defined in Nuc.asm, it
is set to class fevent in file events.
FEXP ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Base e exponential.
FEXPM1 ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Raise e to the power r1 and subtract one, giving r2.
FFA ( class -- ffa )
OOPprimitive Class/qpClass
Given a pointer to a class, returns the flag field address.
fFcb ( -- obj )
files Nuc2.asm/setup
An object pointer that is set to class file in Files. Used for some
basic file-handling, especially before Files is loaded.
FILE ( -- : name )
Files Files/pFiles
A standard class. Used to call Toolbox file routines, has 138 bytes for
a file control block.
FILE-MARK ( -- -300 )
Files Files/pnuc1
A constant. Marks the start of a loaded file - we plant some useful
info there. We put the file name in the dic as if it's a definition
name, but use file-mark as a "handler code". Then after that we put the
useful info. See file extrasMod.
FILL ( addr n c -- )
LowStrings Nuc2.asm/pnuc2
Beginning at address, fills n bytes with given 8-bit value c.
FIND ( str-addr -- xt n | -- str-addr 0 )
Compiler Nuc2.asm/pnuc4
ANSI standard. Looks up the dictionary for the given counted string. If
the search succeeds, the returned xt is of the found dictionary entry,
and n is -1 for a non-immediate word and 1 for an immediate word. If
the search fails, the original string address is returned unchanged and
n is zero.
FIND-WINDOW ( Tpoint -- region ^window )
Events Nuc2.asm/pnuc2
Calls the Window Manager routine FindWindow to find the window in which
a mouse-down event occurred at Tpoint, a Toolbox point in global
coordinates. Leaves the region of the window in which the mouse-down
occurred and ^window, the pointer to the window object's private data.
FINFO ( -- addr )
Nuc2.asm
(68k Mops only) NOTE: This is only valid for systems where no
AppleEvents are available. Therefore if they are available, we return a
nil pointer. Leaves a relative pointer to the Finder information area.
The following code will scan the information block, and print the
Vref#, file type, version and file name for each file passed by the
Finder.
FIX_CACHES ( addr len -- )
Compiler pnuc3
(PowerMops only) Does whatever cache flushing is needed on the PowerPC,
to allow instructions which have been stored in the range given by
(addr len) to be subsequently executed. (On the 68k, we use
PATCHES_DONE which doesn't take a range)
FLN ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Log to base e.
FLNP1 ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Log to base e, plus 1.
FLOAT> ( r -- n )
FloatingPoint floating point
(68k Mops only) Converts the float to an integer. Rounds.
FLOG ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Log to base 10.
FNEGATE ( r -- -r )
PowerMops: ( -- ) ( F: r -- -r )
FloatingPoint floating point/pnuc1
Floating negate.
FNF ( -- -43 )
Files Files/pFiles
A constant. Mac File Manager result code fnfErr. File not found.
FNIP ( r1 r2 -- r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r1 r2 r1 )
FloatingPoint floating point/pnuc1
FOR ( limit -- )
ControlStructures Nuc2.asm/qpCond
Marks beginning of a FOR ... NEXT loop. These are simple loops that
have less overhead than DO loops. The loop index i counts down from
limit-1 to zero. The initial limit must be less than 64K. Uses a DBRA
loop instruction for speed. You can't LEAVE a FOR ... NEXT loop.
FORGET ( -- : word )
Compiler Nuc2.asm/pnuc3
Deletes the word from the dictionary and ALL entries above it (i.e., in
higher memory). Issues message "in protected dictionary" if the word is
below fence, and aborts. FORGET is now deprecated in ANSI Forth, and
shouldn't be used in new code. It isn't really adequate in PowerMops,
since it can't handle the data area, but we keep it for backward
compatibility. We recommend that you now use MARKER instead.
FORWARD ( -- : name )
Compiler Base/qpCond
Creates a word which is to be defined later with :f, the special colon
compiler for forward-referenced Mops words, because :f makes the word
behave like a colon definition.
FOVER ( r1 r2 -- r1 r2 r1 )
PowerMops: ( -- ) ( F: r1 r2 -- r1 r2 r1 )
FloatingPoint floating point/pnuc1
FPRECT ( -- obj )
system Nuc.asm/setup
A Rectangle object. Used in calculation for scrolling fWind.
FPU? ( -- n )
FloatingPoint Nuc2.asm
(68k only) A value. Set by a _Gestalt call in the startup code to the
FPU status.
FREE ( -- )
System Nuc2.asm/pnuc2
Glue routine for the FreeMem toolbox call. Returns the number of free
bytes in the heap.
FREEBLK ( -- )
System Nuc2.asm/pnuc2
Glue routine for the MaxMem toolbox call. Returns the maximum free
bytes that could be obtained in a single block.
FROT ( r1 r2 r3 -- r2 r3 r1 )
PowerMops: ( -- ) ( F: r1 r2 r3 -- r2 r3 r1 )
FloatingPoint floating point/pnuc1
FSIN ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP sine.
FSINH ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP sinh.
FSP! ( -- )
Stack pnuc1
PowerMops only. Clears the floating point stack.
FSP0 ( -- n )
Compiler Nuc2.asm/setup
A value. The address of the base of the floating point stack.
FSQRT ( r -- sqrt )
PowerMops: ( -- ) ( F: r -- sqrt )
FloatingPoint floating point/zFloating point
FSQRT ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) Square root.
FTAN ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP tangent.
FTANH ( PPC/ ( -- ) ( F: r1 -- r2 ) )
FloatingPoint zFloating point
(PowerMops only) FP tanh.
FTUCK ( r1 r2 -- r2 r1 r2 )
PowerMops: ( -- ) ( F: r1 r2 -- r2 )
FloatingPoint floating point/pnuc1
FVALUE ( r -- : name )
PowerMops: ( -- ) ( F: r -- )
FloatingPoint Nuc2.asm/qpCreate
FP analog of value, can use prefix operators.
FWIND ( -- obj )
system Nuc2.asm/setup
The Mops console window, class window.
FWIND? ( -- b )
system Nuc2.asm/setup
A value. True if we're using fWind.
FWINDACTIVE? ( -- b )
system ObjInit/zObjinit
A value. True if fWind is the front, active window.
G->L ( point -- point' )
Quickdraw Event
Convert a global point to a local point.
GENERAL ( -- )
OOP Class/zClass
Sets the "general" option on a class, which forces an ivar of that
class to be a general object with a class pointer (so it can be
late-bound to) even if it's within a record. Normally you should just
not put such ivars in a record, but using GENERAL gives a bit of extra
security, for classes for which you know that they will definitely be
late-bound to. (An attempt to late-bind to an ivar without a class
pointer will give the "not an object" error at run time, which isn't
easy to track down.) Note that indexed classes are always general
anyway. Also if there's a message sent to [self] somewhere in one of
the methods, we know that the class *must* be general, so in this case
we simply set the general attribute. But note that GENERAL classes may
not be used to map ivars to Mac toolbox calls because the class header
information will be included.
GestaltAvail? ( -- b )
System Nuc2.asm/pnuc1
(68k Mops) Set True by the startup code if the Gestalt trap is
available. (PowerMops) Always returns True, since Gestalt is always
available on the PowerPC.
GETDIRID ( -- dirID )
Files Files/pFiles
Returns the dirID of the last directory opened by a standard file call.
This is merely the contents of the Mac global variable CurDirStore.
GETRES ( type resID -- handle )
Resources Base/pBase
Calls GetResource.
GETSPACE ( -- )
System Nuc.asm/pnuc1
A system vector.
GETSTRING ( id -- addr len )
Resources Base/pBase
Gets the string from the mops.rsrc file with the given resource ID.
GOTOXY ( x y -- )
QuickDraw Nuc2.asm/pnuc2
Calls toolbox MoveTo.
GOTPARMS? ( -- rc )
Events Nuc2.asm
This can be called at the end of a handler, to check if we got all the
parameters.
GRAFPORT ( -- : name )
Quickdraw QD
A standard class. Used to map into the QuickDraw GraphPort record. But
note that most record members are not named.
HANDLE ( -- : name )
OOP Struct/pStruct
A standard class.
HANDLEARRAY ( #elems -- : name )
OOP Struct/pStruct
A standard class. HANDLEARRAY and HANDLELIST are for the implementation
of collections of heap-based objects. HandleArray has normal array
properties. Use HandleList if the number of elements may grow
arbitrarily large, and if indexing isn't so important. HandleArray also
includes methods to allow the array to be used as a stack - needed for
FileList.
HANDLELIST ( #elems -- : name )
OOP Struct/pStruct
A standard class. HANDLELIST allows the implementation of a list of
heap-based objects. Unlike HANDLEARRAY, the list can be of indefinite
length. We use a heap block to store the handles to the objects
contiguously, rather than have a separate block for each handle and
link them together. This saves on memory overhead and reduces the
number of memory manager calls. It also reflects the assumption that
insertions and deletions into the middle of the list will be
infrequent, as these could be more inefficient than with a linked
scheme. We expect that elements will normally be added to the end, and
probably not removed at all, or not very often.
HASH ( str255 -- n )
Compiler Nuc2.asm/pnuc1
Hashes the str255 format string into a 32-bit hash value. Names of
selectors and instance variables are hashed to conserve space and speed
up searches.
HEADER ( -- )
compiler Nuc2.asm/pnuc4
Creates a dictionary header using the next word in the input stream.
HEADROOM ( -- n )
Compiler Nuc2.asm/pnuc1
On the 68k, returns the distance from DP to the top of the A4
addressing range - code will be a little less efficient above this
range. In PowerMops we return the distance from CDP to the top of the
mainCode addressing range - that's probably somewhat useful, though the
distance from DP to the top of the mainData addressing range would be
useful as well.
HERE ( -- addr )
Compiler Nuc2.asm/pnuc1
Returns the address of the next available memory location in the
dictionary, or in PowerMops, the address of the next available location
in the data area.
HEX ( -- )
NumericConversion Nuc2.asm/pnuc1
Sets base to 16.
HIDE ( -- )
Compiler Nuc2.asm/pnuc4
Hides the last dictionary header so that FIND won't find it. REVEAL
brings it back again. Use this if you want the previous use of the
name, i.e. if you DON'T want recursion.
HidePen ( -- )
Quickdraw QD
A direct call to HidePen.
HL-EVT ( -- false )
Events Event
An action word for fevent. Handles High-level events. Several vects are
involved.
HLD ( -- addr )
System Nuc2.asm/pnuc1
This value is the address of the latest Hold character during numeric
output conversion.
HLD ( -- addr )
system Nuc2.asm/pnuc1
The address of the next character position in the numeric string being
generated.
HLEventVEC ( -- )
Events Event
A vect. Called for generic high-level events. Default is vfalse.
HOLD ( c -- )
NumericConversion Nuc2.asm/pnuc2
Inserts the character into a string being built by a <# ... #>
sequence. standard
HOME ( -- )
Console Nuc2.asm/pnuc2
Moves the cursor to the upper left corner of the current window.
I ( -- n )
ControlStructures Nuc2.asm/pnuc1
Fetches the current loop index. (The loop index is stored in a machine
register.)
I->L ( 16-bit-number -- 32-bit-number )
Toolbox Nuc2.asm
(68k Mops only) Converts the 16-bit half-cell on top of stack into a
full 32-bit Mops cell, extending the sign bit. i->l is useful in
handling the result from Macintosh ROM routines that return a 16-bit
signed integer on the stack. i->l differs from Extend in that i->l
pushes two bytes onto the stack while extending the sign, whereas
extend only extends the sign of a 16-bit integer contained in the
32-bit cell on top of stack, converting it into a 32-bit signed
integer. Word0, a related word, pushes two zero bytes onto the stack.
I/O_ERR ( err# -- )
Errors Base/zBase
A forward definition to be called when there is an i/o error.
IBEAMCURS ( -- )
Quickdraw QD
Sets the cursor to this.
IDXBASE ( -- addr )
OOP Nuc2.asm/pnuc1
Returns the address of the beginning of the current indexed object's
indexed data area. Gives an error if there's no current object, or if
it isn't indexed.
IF ( ? -- )
ControlStructures Nuc2.asm/qpCond
Marks the beginning of an IF... THEN or IF ... ELSE ... THEN program
flow sequence. Gives an error if there's no current object, or if it
isn't indexed.
IFA ( class -- ifa )
OOPprimitive Class/qpClass
Given a pointer to a class, returns the ivar field address.
IMMEDIATE ( -- )
Compiler Nuc2.asm/cg7
Standard Forth word
INDEXED ( n -- )
OOP Class/zClass
Sets a class and its subclasses to indexed, with elements of width n
bytes. Used after the superclass declaration list when defining a new
class. Note that when instantiating an indexed class, you MUST precede
the instance name with the number of elements you wish that instance to
have. Also note that all indexed classes are automatically declared to
be GENERAL, so you may not used indexed classes to map into toolbox
calls. Also, n must be < 32K (see LARGE).
INDEXED-OBJ ( -- : name )
OOP Struct/pStruct
A standard class. Class INDEXED-OBJ is the generic superclass for all
arrays. Here we define the general indexed methods, which apply
regardless of indexed width.
INFRONT ( -- -1 )
Windows Window
A constant.
INITFONT ( -- )
System Window
Initializes text characteristics.
INIT_ACTIONS ( -- )
FrontEnd Struct/pStruct
A system object, of class x-col, with 8 elements. Any special run-time
initialization can be done conveniently by adding the appropriate words
to the x-col INIT_ACTIONS. These words will be executed on startup via
EXTRA_INITS, right after OBJINIT.
INLINE{ ( -- : word ... } )
Compiler Args/cg6
Commences an inline definition (must come straight after the : <name>
or :m <name>). Allows faster execution. We assume that inline
definitions will be fairly short, and are to be optimized for speed.
The text within the inline{ and the } is saved and recompiled each time
the inline word is to be compiled, so that no call and return is needed.
INSTEAD ( c-old c-new -- )
Strings StrUtilities/zArgs
May be used just after a SCON is defined. Within the SCON, it replaces
any occurrences of c-old with c-new. This operation is useful for
creating SCONs containing special characters such as tab.
INSTLD? ( -- b )
system Nuc2.asm/setup
A value. Set True if an installed application is running. Can be
useful. Very useful.
INTERPRET ( -- )
System Nuc1.asm/cg7
INTERPRET is the interpretation loop. Words from the input stream are
interpreted until the input is exhausted.
INTRP1 ( -- : word )
Compiler Nuc2.asm/cg7
Interprets one word/number from the input stream.
INVERT ( n1 -- n2 )
Logical Nuc2.asm/pnuc1
Inverts all the bits in n1. Synonym to NOT.
IOWAIT ( -- )
Files Files/pFiles
Repeatedly calls busy and pause, will exit if busy returns false.
IVARLEN ( obj -- n )
OOPprimitive Class/qpClass
Given a class pointer, returns the ivar data length. An alias for DLEN.
ivFind ( str-addr -- ^ivar offs xdispl-offs true | -- str-addr false )
Compiler Class/qpClass
Called when we've parsed a selector. It determines if the next word is
an ivar. Note: if found, <findIV> returns to us the equivalent of the
cfa of a method, which for ivars, is the addr of the class pointer.
ivFindM ( selID ^ivar -- offs xt )
OOPprimitive Class/qpClass
Finds a method's xt given a selID and an ivar address.
J ( -- n )
ControlStructures Nuc2.asm/pnuc1
Index value for the next outer DO ... LOOP control structure.
K ( -- n )
ControlStructures Nuc2.asm/pnuc1
Index value for the 2nd outer DO ... LOOP control structure.
KEY ( -- c )
Events Nuc.asm/pnuc2
A system vector. The action of key is normally (key).
KEY! ( -- )
Events Nuc.asm
(68k Mops only) A system vector. Restores default action for KEY. (In
PowerMops we never change it, so we don't need to restore it.)
KEY-EVT ( -- keywd modswd T | -- F )
Events Event
An action word for fevent. Gets key value if true. Handles command-key
menu actions. Does not handle "normal" key actions, that is up to your
code.
KEY? ( -- b )
Events Nuc2.asm/pnuc2
Performs a 40 ?Event. Synonym for ?TERMINAL. Used in class Mouse, and
in the utility word ?pause to test for a keyboard event.
KONST ( -- n : konstName )
ToolBox tool.txt/zCallsMod.txt
Returns a Mac system constant. For example, konst kAEQuitApplication
will return the event id 'quit' on the stack.
L->G ( point -- point' )
Quickdraw Event
Convert a local point to a global point.
L>NAME ( lfa -- nfa )
compiler Nuc2.asm/pnuc1
Converts a link field address to a name field address.
LARGE ( -- )
OOP Class/zClass
(68k Mops) Sets the "large" option on an indexed class, allowing the
number of elements to be greater than 32k. (PowerMops) The number of
elements can always be greater than 32k, so LARGE is ignored.
latest ( -- nfa-1 )
Compiler Nuc.asm/pnuc1
A value. Leaves the nfa of the last defined word.
LEAVE ( -- )
ControlStructures Nuc2.asm/qpCond
There is also a change to LEAVE, which is now a "leaping LEAVE". When
LEAVE is executed, it now causes the loop to be left immediately,
rather than waiting until the next time LOOP is encountered.
LENGTH ( addr -- addr+2 len )
Strings Nuc2.asm/pnuc1
Like COUNT, but uses a 2-byte length.
LENGTH: ( -- len )
OOP Class/zClass
A method. Gets total length of object. Length will include class header
information only if class is of type GENERAL. Otherwise, length is
merely the length of the ivar data field(s).
LIMIT ( -- n )
OOP Nuc2.asm/pnuc1
Returns the maximum numbr of elements of the current indexed object.
Line ( dh dv -- )
Quickdraw QD
A direct call to Line.
LineTo ( h v -- )
Quickdraw QD
A direct call to LineTo.
LINK> ( lfa -- cfa )
compiler Nuc2.asm/pnuc1
Converts a link field address to a code field address.
LIT ( n -- )
Compiler Base/zBase
A state-smart version of LITERAL. Corresponds to LITERAL in Fig-Forth
or original Neon, whereas our present LITERAL is Forth-83.
LITERAL ( n -- )
System Nuc2.asm/cg5
standard
LITW ( n -- )
Toolbox Base
(68k Mops only) Used for toolbox calls. Pushes a 16-bit literal.
LN ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Natural logarithm.
LN(10) ( -- r )
FloatingPoint floating point
(68k Mops only) An fcon. Returns the natural logarithm of 10, 2.302...
LN1 ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) ln(1+x)
LOCAL ( -- : name { parm1 parm2 ¥ loc1 loc2 } )
Compiler Args/zArgs
Begins definition of a local section. Within a local section, all words
have access to the parms/locals.
LOG ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Log base 10 of given float.
LOG2 ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Computes the base 2 logarithm.
LOG21 ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) log2(1+x). I don't think LOG21 is a very helpful name
(pure computerese), but I guess we're stuck with it.
LONGWORD ( -- : name )
OOP Struct/zStruct
A standard class. Generic superclass for var, handle etc.
LOOP ( -- )
ControlStructures Nuc2.asm/qpCond
Marks end of DO ... LOOP structure.
LSHIFT ( n1 n2 -- n3 )
Arithmetic Nuc2.asm/pnuc1
Shifts n1 to the left by n2 bit positions. e.g. 3 2 << will yield 12
(0011) -> (1100). ANSI synonym for <<.
M* ( n1 n2 -- d )
arithmetic longmath/pnuc1
Mixed multiply.
M/MOD ( d n -- rem quot )
Arithmetic pnuc1
PowerMops only. Signed mixed division of a 64-bit dividend by a 32-bit
divisor, giving 32-bit remainder and quotient.
MAKEINT ( 32-bit-num -- 16-bit-num )
Toolbox Nuc2.asm
(68k Mops only) Drops the higher 16 bits of the number on top of the
stack. This is used for Toolbox calls that require an Int value.
MARKER ( -- : name )
Compiler Base/zBase
Now preferred to FORGET. MARKER <name> defines a word <name> that when
executed, returns the dictionary to its state just before MARKER was
executed. In PowerMops this allows us to reset the data area as well as
the code area. You can still use FORGET, but this only resets the code
area. We recommend you now use MARKER.
MARK_FILE ( -- )
Compiler Files/pFiles
Internal Mops use only. Called when we're starting to load a source
file. Places a marker in the dictionary so that we can locate the
source file corresponding to a particular word.
MAX ( n1 n2 -- n3 )
Arithmetic Nuc2.asm/pnuc1
n3 is the maximum of n1 and n2 (signed).
MAXDIC ( -- n )
Compiler Nuc2.asm
(68k Mops only) A value used by the startup code - set to the value
specified for the dictionary size in the Install dialog.
MBADDR ( -- addr )
Menus Event
We store our menubar reference here.
MBAR ( -- : name )
Menus Menu
A standard class. The Mops class for handling the menubar, contains an
array of up to 10 menu objects. The default Mops mbar object is
menubar, which is stored in the dicaddr object MBaddr.
MENU ( -- : name )
Menus MenuMod.txt
A standard class, subclass of x-array. The Mops object oriented
approach to handling menus.
MENUBAR ( -- obj )
Menus Menu
Our default mbar object, stored in MBaddr.
MFA ( class -- mfa )
OOPprimitive Class/qpClass
Given a pointer to a class, returns the methods field address.
MIN ( n1 n2 -- n3 )
Arithmetic Nuc2.asm/pnuc1
n3 is the minimum of n1 and n2 (signed).
MINHEAP ( -- n )
Compiler Nuc2.asm
(68k Mops only) A value used by the startup code - set to the value
specified for the heap size in the Install dialog.
MLOCAL ( -- : name { parm1 parm2 ¥ loc1 loc2 } )
Memory Args
Starts a local section for methods. See local.
MOD ( n1 n2 -- rem )
Arithmetic Nuc2.asm/pnuc1
Returns remainder of division of n1 by n2.
MOUSE ( -- : name )
Events Event
A system class for dealing eith the mouse and events. Our Mops mouse
object is theMouse.
MOUSE-EVT ( -- false )
Events Event
An action word for fevent. Handles mouse events.
MouseMoved ( -- )
Events Event
A vect. Called for mouse moved.
MOVE ( src dest cnt -- )
Memory Nuc2.asm/pnuc2
As for CMOVE, but n may be anything. Implemented by calling the toolbox
routine BlockMove/BlockMoveData. This gives optimized handling of
longer moves (n > 20 say). Also accounts for situations where the
source and destination areas overlap. If you want byte propagation
effects, use CMOVE instead. But what would you want this for, anyway,
since we have FILL?
MOVEPEN ( dv dh -- )
Quickdraw QD
A direct call to Move.
MoveTo ( h v -- )
Quickdraw QD
A direct call to MoveTo.
MSELECT ( point -- item# menuID )
Menus Menu
Calls menu manager MenuSelect to track a menu selection.
MSG# ( -- : lit )
Errors Base/zBase
Displays given string number (a literal) from the mops.rsrc file,
preceded by "Msg#..."
MWORD ( -- addr )
Lowstrings Nuc2.asm/pnuc2
"Mops word". Called by DEFINED? which is called by INTERPRET. Calls
WORD with a blank as delimiter, and converts the string to upper case.
Leaves counted string at addr (will be HERE).
MyDoc ( -- addr len )
Frontend Files/pFiles
Front end support for loading files.
MyDocName ( -- str255 )
Frontend Files/pFiles
A variable with 28 bytes allotted.
N, ( addr len -- )
Compiler Nuc2.asm/pnuc3
Places the bytes designated by (addr len) in the dictionary where DP
points, and adds len to DP.
N>COUNT ( nfa -- addr len )
Compiler Nuc2.asm/pnuc2
Returns the address and length of a name field, suitable for use by
"type".
N>LINK ( nfa -- lfa )
compiler Nuc2.asm/pnuc1
Converts a name field address to a link field address.
NAME> ( nfa -- cfa )
compiler Nuc2.asm/pnuc1
Converts a name field address to a code field address.
NAME? ( addr -- addr b )
Compiler Nuc2.asm/pnuc4
Returns True if the passed-in addr appears to be an xt with a
corresponding valid name field.
NEED ( -- : filename )
System Extrasmod.txt/zExtrasmod.txt
Will load the named file, if the file is in our path definition. Put
NEED XXX at the start of a file that requires XXX to be already loaded.
If the word XXX is not defined, a file of that name is loaded. Note
that only one blank or tab is allowed between NEED and the filename.
This is because we use WORD" to read the filename, so that names with
embedded blanks are allowed.
NEG> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator, which negates. Use for values and named parameters
and locals. Also works for floats.
NEGATE ( n -- -n )
Arithmetic Nuc2.asm/pnuc1
Changes the sign of n.
NEXT ( -- )
ControlStructures Nuc2.asm/qpCond
Marks end of a FOR ... NEXT loop. See FOR.
NEXTEVENT ( ^event mask -- b )
Events Nuc2.asm/pnuc2
Calls WaitNextEvent if it's available, otherwise GetNextEvent (which
should only be on very old Macs).
NEXT_TASK ( -- )
Events Event
A vect. If multitasking is installed, this will be redirected to do a
task switch.
NIF ( ? -- )
Controlstructures Nuc2.asm/qpClass
Like IF except execution occurs when ? is zero.
NILH ( -- $FFA00101 )
Memory Nuc2.asm/setup
A constant. The value we use for a nil handle.
NILP ( -- $FFA00103 )
Memory Nuc2.asm/setup
A constant. The value we use for a nil pointer.
NIP ( n1 n2 -- n2 )
Stack Nuc2.asm/pnuc1
Removes stack item just under top.
NOMEM ( -- )
Errors Base/zBase
A forward definition to be called when (not if!) we run out of memory.
NOT ( n1 -- n2 )
Logical Nuc2.asm/pnuc1
Inverts all the bits in n1. Synonym to INVERT.
NOT> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator, which logically NOTs (inverts all bits). Use for
values and named parameters and locals. Not for floats.
NULL ( -- )
System Nuc2.asm/setup
A word that does nothing.
NULL-EVT ( -- false )
Events Event
An action word for fevent. Will send late bound idle: to the actW, if
it is non-zero.
NULLOSSTR ( -- xt )
System Base/zBase
NUM? ( addr -- n true | -- false )
Console Nuc2.asm/pnuc2
NUMBER ( addr -- n )
compiler Nuc2.asm/pnuc2
Attempts to convert the counted string at addr to a number, by calling
COUNT followed by >NUM?. If the string isn't a number (>NUM? returned
false), we give the "undefined word" error. If the number contains a
".", n will be double-length.
NUNTIL ( ? -- )
ControlStructures Nuc2.asm/qpCond
Similar to until. Stop if ? is-zero.
NWHILE ( ? -- )
ControlStructures Nuc2.asm/qpCond
Similar to while. Continue if ? is zero.
OBJ> ( addr -- xt | 0 )
OOPprimitive Class/qpClass
Takes an obj's base addr, and returns the xt of its dic entry, or zero
if none.
OBJ? ( ?obj -- ?obj class | -- ?obj 0 )
Compiler Nuc2.asm/pnuc4
General test for an object. Not completely rigorous, so we shouldn't
use it in a TRAV, but pretty good nevertheless. If it is an object, the
class is left in theClass. We do assume the passed-in value may not be
a legal address at all, since we want to use this word in stack dumping.
OBJECT ( -- class )
OOP Class/qpClass
The root class of all classes. Only used as a declared superclass when
defining a new class. Note that class object has the pre-defined
methods class:, .id:, .class:, addr:, length:, copyto:, classinit:,
release:, dump:, and print:. So ALL objects possess these methods. Some
of these methods do nothing, for class object.
ObjFindM ( selID obj -- xt offs xdispl-offs )
OOPprimitive Class/qpClass
Finds a method's xt given a selID and an obj addr. Results are as for
<findM>.
OBJHANDLE ( -- : name )
OOP Struct/pStruct
A standard class. An OBJHANDLE is a handle that points to an object in
the heap.
OBJINIT ( -- )
System Nuc.asm/zObjinit
(68k) A system vector. Normally contains sysinit, defined in file
Objinit. Does class-related initialization at startup. In PowerMops we
just re-resolve the forward definition RUN (see file zObjinit).
OBJLEN ( -- n )
OOPprimitive Class/qpClass
Returns total data length of current object.
OBJPTR ( -- : name )
OOP Nuc2.asm/qpCreate
An object pointer is a "low-level" entity, rather like a value. The
syntax for object pointers is: objPtr anObjptr class_is theClass
OBJ_ARRAY ( #elems -- : name )
OOP Struct/pStruct
A standard class. OBJ_ARRAY is a generic superclass which makes it easy
to generate an array of objects of a given class. Just define a new
class which multiply inherits from the given class (or classes) and
OBJ_ARRAY (which must come last). This will add an indexed section to
each object of the new class, with elements wide enough to contain
objects of the original class. Then SELECT: "switches in" the selected
element to be the "current" element, and all the normal methods of the
class can then be used. Note the use of"32767 indexed" in the class
definition.
OF ( n1 n2 -- | n1 )
ControlStructures Base/zBase
Use within a CASE structure. Yields n1 and jumps to beyond next ENDOF
if no match.
OK ( -- )
Compiler Nuc2.asm/cg7
Prints the Mops prompt, commonly 0->.
OK? ( rc -- )
Files Base/zBase
A useful word to use after an I/O operation.
OpenAppVec ( -- code True | -- False )
Events/pnuc1 Nuc.asm
As set up in Mops, OpenAppVec simply returns False and does nothing
else.
OpenDocVec ( -- code True | -- False )
Events/pnuc1 Nuc.asm
OpenDocVec finds the number of files in the given list of files, and
puts the number in the value #DocsToOpen. It then handles each file in
the given list fFcb, then calling the sufficient for your appropriately.
OPENMR ( -- )
Resources Base/pBase
open the Mops system resource file (mops.rsrc) if necessary.
OpenResFile ( addr len -- )
Resources Base/pBase
Opens named resource file.
OPT? ( -- b )
System Nuc2.asm
(68k Mops only) A value. Disables optimization if set False. Normally
True. Set it False if you have an obscure bug, to check if the
optimization is generating invalid code.
OR ( n1 n2 -- or )
Logical Nuc2.asm/pnuc1
Bitwise OR.
OR> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator, which does a bitwise OR with n. Use for values and
named parameters and locals. Not for floats.
ORDERED-COL ( #elems -- : name )
OOP Struct/pStruct
A standard class. Ordered-Collection is a collection of 4-byte cells. A
subclass of (col) and array.
OS-EVT ( -- false )
Events Event
An action word for fevent. Handles operating system events by calling
various vects.
OUT ( -- n )
system Nuc2.asm/pnuc1
Counts up by one for each character EMITted.
OVER ( n1 n2 -- n1 n2 n1 )
Stack Nuc2.asm/pnuc1
Same as 2 pick.
PACK ( x y -- x:y )
Toolbox Nuc2.asm/QD
Packs two 32-bit signed numbers into one 32-bit number. Only the lower
16 bits of x and y are used. You can use pack to convert a coordinate
point into a Toolbox-compatible point. Even in PowerMops we still need
PACK and UNPACK, since the Toolbox takes and returns a packed Point in
a couple of places.
PAD ( -- addr )
system Nuc2.asm/setup
Returns the address of the text output buffer, a temporary area of
memory of 256 bytes. Mops uses PAD to hold information (text, numbers)
for intermediate processing. You may use it to the same end, but be
aware that output words like emit and type may interfere by using pad
as well.
PARSE-DLM-STR ( addr1 addr2 len -- b )
Lowstrings Nuc2.asm/pnuc2
Scans the source for a string delimited at the start and end by c.
Everything is skipped before the first delimiter. If the source gets
exhausted in the process, REFILL is called to get more.
PARSE-SRC ( c -- addr len )
Lowstrings Nuc2.asm/pnuc2
Scans the source for delimiter c. Returns the addr and len of the
parsed string, and updates the source.
PARSE-WORD ( c -- addr len )
LowStrings Nuc2.asm/pnuc2
As for PARSE-SRC, but any consecutive initial delimiters are skipped.
If the input is exhausted in the process, REFILL is called to get more.
PATCHES_DONE ( -- )
Compiler Nuc2.asm
(68k Mops only) If you ever need to patch instructions, call this when
you're finished. It flushes the instruction cache if necessary to make
sure that the new instructions will really be executed. PATCH and
(PATCH) call it already, so if you are using these, you don't need to
call Patches_done. (On the PowerPC, we use FIX_CACHES.)
PATTERN ( -- : name )
Quickdraw QD
A system class, subclass of resource.
PAUSE ( -- )
Events Nuc.asm/pnuc1
A system vector, normally contains (pause), defined in file Frontend.
PAUSE should be called at strategic intervals in all applications,
unless Key is being called frequently. Pause normally calls next:
fEvent which allows a task switch to be done under MultiFinder, and
which also handles any pending events for this task, such as window
updates. Remember to disable any menus etc. that you don't want to
execute in this situation! Unexpected re-entrancy is a good way to bomb!
PI ( -- r )
FloatingPoint floating point
(68k Mops only) An fcon. Returns 3.1415...
PICK ( ... idx -- ... n )
Stack Nuc2.asm/pnuc1
Given a zero-based index into the stack, will copy the requested cell
to the top of the stack. Stack depth increases by one. 0 pick is
equivalent to dup.
PLACE ( addr1 len addr2 -- )
Lowstrings Nuc2.asm/pnuc2
Converts string ( addr1 len ) to a counted string at addr2. Appends a
zero byte.
PLUSCURS ( -- )
Quickdraw QD
Sets the cursor to this.
POINT ( -- : name )
Quickdraw QD
A standard class for dealing with QuickDraw points. Note that Mops
prefers to treat all points and operations with points as 2 items on
the stack, rather than a single packed 32-bit number.
POPPORT ( GrafPtr -- )
Quickdraw QD
Calls SetPort.
POSTPONE ( -- )
Compiler Nuc2.asm/qpCond
Standard Forth word. Postpone xxxx compiles a call to the word xxxx,
even if xxxx is immediate.
PPC? ( -- b )
Compiler Base/setup
True if we're compiling PPC code
PRINT: ( -- )
OOP Class/zClass
A method. Use to display a class, default is just a DUMP:.
PrintDocVec ( -- code True | -- False )
Events Nuc.asm/pnuc1
As set up, Read1DocVec assumes the file is a Mops dictionary.
Read1DocVec must point to a routine which will read the file designated
by the file object fFcb, close it, and return a result on the stack.
True indicates the OpenDocVec loop can continue. False means the loop
must terminate. You could return False, for example, on an error, or
simply if your application can't accept more than one document open at
a time.
PRIVATE ( -- )
OOP Class/zClass
Use within a class definition. Makes the following methods privateムthat
is, they will be accessible from within this class or any of its
subclasses, but not from anywhere else. The criterion is simply that a
call to Self of Super may access a private method, but nothing else
can. Note that for this reason you can't late-bind to a private method,
even if you do it from within the class itself.
PROCESSOR ( -- n )
System Nuc2.asm
(68k only) A value. Set by a _Gestalt call in the startup code to the
number corresponding to the processor we are running on.
PTR ( -- : name )
OOP Struct/pStruct
A standard class. For toolbox pointers.
PUBLIC ( -- )
OOP Class/zClass
Makes the following methods publicムthat is, they will be accessible
from anywhere. PRIVATE and PUBLIC may be used any number of times
within the one class definition. Methods are initially public when a
class compilation starts.
PUSHPORT ( -- GrafPtr )
Quickdraw QD
Pushes the current Graphport onto the stack as a GrafPtr. Calls GetPort.
qd ( -- addr )
system setup
(PowerMops only) The base of the QuickDraw globals area.
QUERY ( -- )
Console Nuc2.asm/pnuc2
Inputs up to 128 characters from the keyboard until a carriage is
typed. Query puts the acquired text at the address TIB and sets the
variable >IN to zero.
QUIT ( -- )
Compiler Nuc2.asm/cg7
S4tandard
QuitAppVec ( -- code True | -- False )
Events Nuc.asm/pnuc1
The current setting for QuitAppVec is simply to call BYE. Your
application will probably want to do something a bit more intelligent.
QUITVEC ( -- )
System Nuc.asm/pnuc1
A system vector.
R> ( -- n )
ReturnStack Nuc2.asm/qpCond
Pops the top return stack value to the stack.
R@ ( -- n )
ReturnStack Nuc2.asm/qpCond
Fetches the top return stack value to the stack. Does not pop the
return stack.
RA? ( addr -- b )
Compiler Nuc2.asm/pnuc4
Returns True if the addr looks like a return address.
RAD2DEG ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Converts radians to degrees.
RANDOM ( n -- rand*n )
Arithmetic QD
Returns a random number from 0 to n-1 inclusive. n is limited to an Int
value. Larger than that means that numbers will be poorly distributed.
Uses the Toolbox call Random, but is not the same.
RANGEOF ( val lo hi -- )
ControlStructures Base/zBase
Use in place of an OF in a CASE structure. Provides conditional
execution if val is within range lo to hi inclusive.
RDEPTH ( -- #cells )
ReturnStack Base/pnuc1
Leaves the number of cells occupied on the return stack. You may find
rdepth useful in debugging your programs.
Read1DocVec ( -- code True | -- False )
Events/pnuc1 Nuc.asm
As set up, Read1DocVec assumes the file is a Mops dictionary.
Read1DocVec must point to a routine which will read the file designated
by the file object fFcb, close it, and return a result on the stack.
True indicates the OpenDocVec loop can continue. False means the loop
must terminate. You could return False, for example, on an error, or
simply if your application can't accept more than one document open at
a time.
RECT ( -- : name )
Quickdraw QD
A standard class for dealing with QuickDraw rectangles. Note that Mops
prefers to treat rectangles, and all QuickDraw coordinates for that
matter, in the form LEFT TOP RIGHT BOTTOM (l t r b), or x1 y1 x2 y2.
RECURSE ( -- )
Compiler Base/zBase
Compiles a call to the definition being compiled. (Its name isn't
visible yet, in case you want to call a previous definition with the
same name.)
REFILL ( -- b )
compiler Nuc2.asm/pnuc2
Attempts to (re)fill the input stream with another line.
RELCNT ( -- n )
OOP Struct/pStruct
A value. For testing - counts release: msgs to make sure we're
releasing everything.
RELEASE: ( -- )
OOP Class/zClass
Our standard destructor method. Any objects that allocate heap storage
will redefine this appropriately. Our convention is that an object will
release ALL its storage when it gets a release: message. Other methods
can be provided to partly release storage, as needed.
RELOC! ( addr dest -- )
Compiler Nuc2.asm/pnuc3
Converts the absolute address addr to relocatable and stores it at the
destination dest. Checks that a module address is not being stored
outside a module, a situation which can easily lead to a trouble when
the address is used.
RELOC! ( addr1 addr2 -- )
Compiler Nuc2.asm/pnuc3
Stores addr1 as a relocatable address at addr2.
RELOC, ( abs-addr -- )
Compiler Nuc2.asm/pnuc3
Converts abs-addr to relocatable, and adds it to the dictionary.
RELOC, ( addr -- )
Compiler Nuc2.asm/pnuc3
Stores addr as a relocatable address at HERE, and advances DP by 4.
RelocCode, ( addr -- )
Compiler pnuc3
(PowerMops only) Stores addr as a relocatable address in the code area
of the dictionary where CDP points, and advances CDP by 4.
REPEAT ( -- )
ControlStructures Nuc2.asm/qpCond
Standard. Marks bounds of BEGIN ... XXX ... REPEAT loop.
RESERVE ( n -- )
Compiler base/pnuc3
Allots the next n bytes in the dictionary (PowerMops: data area of the
dictionary) and erases them.
RESOURCE ( -- : name )
OOP Struct/pStruct
A standard class. Provides basic support for Toolbox resources.
REST ( -- addr len )
compiler Nuc2.asm/pnuc2
Returns the addr and len of the unparsed part of the current input line.
RESTORE-INPUT ( x1...xn n -- )
Compiler Base/pBase
Restores the current position in the input stream. n is the number of
cells of saved information - currently it is 4.
RESTPORT ( -- )
Windows Window
Restores the current GrafPort from the variable thePort via a call to
SetPort.
RESUME? ( -- b )
Events Event
A value. True if we've just received a Resume event.
ResumeVec ( -- )
Events Event
A vect. Called for resume.
RET ( -- 13 )
Strings String/pString
A constant, returns ascii value of a carriage return character.
REVEAL ( -- )
Compiler Nuc2.asm/pnuc4
Makes the current name visible again. See HIDE.
RNDWIND ( -- 16 )
Windows Window
A constant.
RNGERR ( -- )
System Nuc.asm/pnuc1
A system vector. Contains range_err, which is defined in file Base.
ROOM ( -- n )
Compiler Nuc2.asm/pnuc1
Returns the number of bytes left in the dictionary, or (PowerMops) in
the code area of the dictionary.
ROOM2 ( -- code-room data-room )
Compiler pnuc1
PowerMops only. Returns the number of bytes left in the code and data
areas of the dictionary.
ROT ( n1 n2 n3 -- n2 n3 n1 )
Stack Nuc2.asm/pnuc1
ROUND ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Rounds the given float to the nearest integer by the
normal rules. Of course we still have a float.
RP! ( -- )
Stack Nuc2.asm/pnuc1
Clears the return stack.
RP0 ( -- addr )
ReturnStack Nuc2.asm/setup
A value. Contains the base address of the return stack.
RP0 ( -- n )
Compiler Nuc2.asm/setup
A value. The address of the base of the return stack.
RP@ ( -- addr )
Stack Nuc2.asm/pnuc1
Returns the address of the top of the return stack before rp@ is
executed.
RSHIFT ( n1 n2 -- n2 )
Arithmetic Nuc2.asm/pnuc1
Shifts n1 to the right by n2 bit positions. e.g. 12 2 >> will yield 3
(1100) -> (0011). ANSI synonym for >>.
RSTA5 ( -- )
Toolbox Base
(68k Mops only) Used for trap compilation. Used after a Toolbox trap
call. Registers A6 and A7 must be exchanged again and A5 set back.
RSTKSPACE ( -- n )
System Nuc2.asm
(68k Mops only) A value. Used by the startup code to allocate space for
the return stack. Initial value: 30000.
RUN ( -- )
System Frontend/zFrontend
System startup word for the Mops development environment.
run ( -- )
Compiler Frontend/setup
(PowerMops - a forward definition, finally resolved in zFrontend.)
Starts normal running of the Mops compiler, after initialization.
S" ( -- addr len : <chars>" )
Lowstrings Nuc2.asm/zBase
At compile time, scans until " is encountered. At run time, pushes the
address and length of the enclosed string. E.g. " hi there" will, at
run time, push (addr len) for the string 'hi there'. The ANSI standard
doesn't define an interpretation:abehavior for this word; however in
Mops it may be used outside a definition, with the proviso that the
string will be stored at HERE, which means that more than one " ..." on
a line will give unexpected results.
S= ( addr1 len1 addr2 len2 -- b )
LowStrings Nuc2.asm/pnuc2
Case sensitive string comparison, true if equal.
S>D ( n -- d )
arithmetic Nuc2.asm/pnuc1
Sign-extends a single to a double.
SAmask ( -- n )
memory Nuc2.asm
(68k Mops only) A value. If you need to call _StripAddress, don't
bother, we've done it for you. Just use SAmask as a mask on the address
as in SAmask and. On the PowerPC all addresses are 32-bit so you don't
need this value.
SAVA5 ( -- )
Toolbox Base
(68k Mops only) Used for trap compilation. Sets up for a Toolbox trap
call. Registers A6 and A7 must be exchanged and A5 set properly.
SAVE ( -- : filename )
System Files/zPEF
Saves the Mops dictionary image to disk with the given filename.
SAVE-INPUT ( -- x1...xn n )
Compiler Base/pBase
Saves the current position in the input stream. n is the number of
cells of saved information - currently it is 4.
SaveActW ( -- wptr )
Events Window
Saves actW over Suspend-Resume.
SAVEPORT ( -- )
Windows Window
Saves the current GrafPort in the variable thePort via a call to
GetPort.
SCAN ( addr len c -- addr' len' )
Lowstrings Nuc2.asm/pnuc2
Searches the string ( addr len ) for the character c. Leaves addr' the
address of the found char, and len' the remaining string length. If not
found, addr' will be one past the end of the string, and len' will be
zero. Assumes len is less than 64K (only 16 bits significant). Class
String+ provides a more complete character search in its chsearch:
method, which has case handling and 32-bit length.
SCAN-SRC ( c -- )
Lowstrings Nuc2.asm/pnuc2
Does a SCAN on the current source, and leaves the source descriptors
(src-addr src-len) updated.
SCON ( -- : name text )
Strings Base/zBase
Defines a string constant. The first nonblank char after the name of
the SCON is the delimiter, and the string starts with the next
character. The string continues to the next occurrence of the
delimiter. So " can be used as usual, but anything else can be used
instead, e.g.: scon <name> /string containing " as non-delimiter/
SCREATE ( addr len -- )
Compiler Nuc2.asm/qpCreate
An interface to Create; takes an addr-len pair representing a string.
SCREENBITS ( -- l t r b )
QuickDraw Struct/setup
Gets dimension coordinates of host machine's display via the Mac global
variable screenbits.
SCROLL ( dh dv -- )
Console Nuc2.asm/pnuc2
Scrolls the current window by dh dv pixels. Uses fprect and ScrollRect.
segTable ( -- addr )
Compiler setup
(PowerMops only) a variable. The address of the base of the segment
table, used in addressing modules.
SELF ( -- obj )
OOP Nuc2.asm/pnuc1
Object reference to self. Only used in a class definition. SELF is not
necessarily the same as ^BASE, because of multiple inheritance.
SEND ( ^obj selID -- )
OOP Class/qpClass
Executes a method given its selID. Used in late binding. Can also be
used if you have a dynamically determined selector.
SEQUENCE ( #elems -- : name )
OOP Struct/pStruct
A standard class. SEQUENCE is a generic superclass for classes which
have multiple items which frequently need to be looked at in sequence.
At present the main function of Sequence is to implement the EACH:
method, which makes it very simple to deal with each element. Sequence
can be multiply inherited with any class which implements the FIRST?:
and NEXT?: methods. The actual implementation details are quite
irrelevant, as long as these methods are supported.
SETFWIND ( -- )
System Nuc.asm/pnuc1
A system vector. Normally contains (sf), defined in file Objint.
setup ( -- )
system setup
(PowerMops only) The word that gets initial execution.
SET_TO_CLASS ( ^obj -- : cname )
OOP Class/zClass
If you need to declare the object pointer before the class exists, use
SET_TO_CLASS once the class is defined, thus: ' someOP set_to_class
someClass.
SET_TO_CLASS ( ^objptr -- : classname )
OOP Class/zClass
If you need to declare the object pointer before the class exists, use
SET_TO_CLASS once the class is defined. :class SOMECLASS super{ object
} ' someOP set_to_class someClass etc.
SF! ( r addr -- )
PowerMops: ( addr -- ) ( F: r -- )
FloatingPoint pnuc1
PowerMops only. Converts the number on the floating point stack to
single-precision (4-byte) format, and stores it at addr.
SF@ ( addr -- r )
PowerMops: ( addr -- ) ( F: -- r )
FloatingPoint pnuc1
PowerMops only. Fetches the single-precision (4-byte) floating point
number at addr to the floating point stack.
SFA ( class -- sfa )
OOPprimitive Class/qpClass
Given a pointer to a class, returns the superclass field address, which
is an N-way pointer.
SFDlgHook ( -- ^proc )
Files Files
(Not in PowerMops yet) A value. Used in std file calls. If non-zero,
points to the proc to be called while the std file dialog is up.
SFIND ( addr len -- xt n | -- addr 0 )
Compiler Nuc2.asm/pnuc4
As for FIND, except that the string for matching is designated by addr
and len.
SFLOC ( -- x:y )
Files Files/pFiles
Computes screen coordinates for top left of SF dialog box. Centers the
box horizontally, and a bit above the center vertically. Returns
coordinates as a packed 32-bit number.
SFOBJ ( -- obj )
Files Files/pFiles
A system object of class SFRec.
SFrec ( -- : name )
Files Files/pFiles
A standard class. Used to call Standard File Toolbox routines.
SHDR ( addr len -- )
Compiler Nuc2.asm/pnuc4
Creates a header for the passed-in string.
ShowPen ( -- )
Quickdraw QD
A direct call to ShowPen.
SIGN ( n -- )
NumericConversion Nuc2.asm/pnuc2
standard
SIN ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Computes sine, given radians.
SKIP ( addr len c -- addr' len' )
Lowstrings Nuc2.asm/pnuc2
Similar to SCAN, but searches for the first character not equal to c.
SKIP-SRC ( c -- )
Lowstrings Nuc2.asm/pnuc2
Skips consecutive delimiters equal to c in the source.
SKIP-SRC+ ( c -- )
Lowstrings Nuc2.asm/pnuc2
As for SKIP-SRC, but if a non-c character is not found, calls QUERY to
get another source line. This word is called by PARSE-SRC-WORD which is
called by WORD, and by doing things this way we can have xt lists etc.
extending over multiple lines.
SLEEPTICKS ( -- n )
Events Nuc2.asm/pnuc1
A value. Used in calls to WaitNextEvent. Default is 20 as set by file
Frontend.
SOURCE ( -- addr len )
compiler Nuc2.asm/pnuc2
Returns the addr and len of the current input line.
SOURCE-ID ( -- n )
compiler Nuc2.asm/pnuc1
Zero if input is coming from the keyboard; address of file object if
input is coming from a file.
SP! ( -- )
Stack Nuc2.asm/pnuc1
Clears the stack.
SP0 ( -- addr )
Stack Nuc2.asm/setup
A value. Contains the base address of the stack.
SP0 ( -- n )
Compiler Nuc2.asm/setup
A value. The address of the base of the data stack.
SP@ ( -- addr )
Stack Nuc2.asm/pnuc1
Returns the address of the top of the stack before sp@ is executed.
SPACE ( -- )
Console Nuc2.asm/pnuc2
Emits an ascii blank (32).
SPACES ( n -- )
Console Nuc2.asm/pnuc2
Emits n ascii blanks.
SPAN ( -- n )
system Nuc2.asm/pnuc2
As in Forth-83. Returns the number of characters read by EXPECT.
SQRT ( r -- sqrt )
PowerMops: ( -- ) ( F: r -- sqrt )
FloatingPoint floating point/zFloating point
SRC-ADDR ( -- addr )
system Nuc2.asm/pnuc1
A value. The address of the current source text being interpreted.
SRC-LEN ( -- n )
system Nuc2.asm/pnuc1
A value. The number of characters still unprocessed in the current
source line.
SRC-START ( -- addr )
system Nuc2.asm/pnuc1
A value. The starting address of the current source line. Used by WORD.
SRCCOPY ( -- 0 )
Quickdraw QD
A constant, equate for drawing mode.
SRCOR ( -- 1 )
Quickdraw QD
A constant, equate for drawing mode.
SRCXOR ( -- 2 )
Quickdraw QD
A constant, equate for drawing mode.
STATE ( -- compile-state )
Compiler Nuc2.asm/pnuc1
This value is the compilation state of the Mops interpreter. A non-zero
value means that the definition of a word, method, or class is being
compiled.
STILLDOWN? ( -- b )
Events Event
(68k Mops only) A direct call to StillDown. Returns true if mouse
button is still down.
STKSPACE ( -- n )
System Nuc2.asm
A value. Used by the startup code to allocate space for the stack. Set
from the Install dialog. Initial value: 30000.
Str255 ( addr len -- ^buf255 )
Strings Base/pBase
Converts text beginning at addr for len characters to a str255 type
string at buf255, leaving the addr of buf255. Note that you should use
the string right away as the next call to str255 will overwrite the
buffer.
STRING ( -- : name )
Strings String/pString
A standard class. This class is changed radically from Neon! We now
keep two offsets into a string - POS and LIM. POS marks the "current"
position, and LIM the "current" end. Most string operations operate on
the substring delimited by POS and LIM, which we call the active part
of the string. We also keep the size of the string (the real size, that
is) in an ivar, so that we can get it quickly without a system call.
See also class string+.
STRING+ ( -- : name )
Strings String+/zString+
A standard class, subclass of string. Provides many extensions.
SUPER ( -- obj )
OOP Class/zClass
Use within a class method definition to refer to the current object,
but the superclass method will be invoked.
SUPER{ ( -- : cname1 cname2 ... } )
OOP Class/zClass
Used to declare the superclass(es) when defining a class. Must follow
:class <className>.
SUSPEND? ( -- b )
Events Event
A value. True if we've just received a Suspend event.
SuspendVec ( -- )
Events Event
A vect. Called for suspend.
SWAP ( n1 n2 -- n2 n1 )
Stack Nuc2.asm/pnuc1
Swaps the top two stack cells.
SYS ( wptr -- )
Events Event
System click handler, a direct call to SystemClick.
SYSINIT ( -- )
System Objinit/zObjinit
SYSINIT is the startup word, called via the vect objinit, that
initializes the nucleus objects for the Mops development environment
above Files.
SYSPAT ( idx -- obj )
Quickdraw QD
Given a zero-based index, returns the system object syspattn (class
pattern) which will be set to a resource pattern from the SysPatList.
Common usage is, e.g.: 4 syspat get: ** will yield a gray pattern
usable with calls like FillRect. See IM I-474 for the pattern list
(subtract 1 from the indices shown in IM).
TAN ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Computes tangent, given radians.
TBOOL ( b -- tbool )
Toolbox Window
Makes a Mops boolean into a Toolbox boolean. Note that tbool should
only be used as a setup for a Toolbox call as the stack will be
mis-aligned until the Toolbox call is done.
tempRect ( -- obj )
System QD
A system object of class rect, useable at anytime for whatever you wish.
TFACE ( n -- )
QuickDraw Window
A direct call to TextFace.
TFONT ( n -- )
QuickDraw Window
A direct call to TextFont.
THEDLG ( -- addr )
Events Event
A variable.
THEMOUSE ( -- obj )
Events Event
The Mops mouse object.
THEN ( -- )
ControlStructures Nuc2.asm/qpCond
standard. Use with IF and NIF.
THEPOINT ( -- addr )
Events Event
A variable.
THEPORT ( -- grfptr )
QuickDraw Nuc2.asm/setup
Returns a grafPtr from the global variable thePort, which always points
to the current port.
THEWINDOW ( -- addr )
Windows Window
A variable.
THREAD ( str-addr -- thread-addr )
Compiler Nuc2.asm/pnuc4
Takes a counted string, and returns the address in CONTEXT of the start
of the appropriate dictionary thread.
THROW ( n -- n | 0 -- )
Errors Nuc2.asm/pnuc3
Standard Forth. If n is zero, drop it and continue. Otherwise exit to
the current CATCH and pass it n.
THROW ( n -- )
Errors Nuc2.asm/pnuc3
If n is non-zero, control passes to the last current CATCH caller, and
the stack depths are reset to what they were when CATCH was executed.
If n is zero, THROW does nothing. See the Standard for a full
description. In Mops, we have two variants--normal THROW, and
ThrowWithInfo. The latter is used by our normal error word DIE, and
also by ABORT", which both save the error info (including a message
string) before doing a normal THROW. ThrowWithInfo signals that the
saved error info is valid. Our default error handler DFLT_DIE, which is
called if no throw handler has been installed, tests this flag to
decide whether to call .ERR to display the info. If THROW is called
directly from code, it flags the error info invalid, which prevents
DFLT_DIE from calling .ERR and displaying spurious info.
throwHandler ( -- addr )
system Nuc2.asm/pnuc1
The address of the current THROW handler, or zero if none.
THROW_WITH_INFO ( n -- )
Errors Nuc2.asm/pnuc3
See THROW.
THUMB ( -- 129 )
Controls Window
A constant.
TIB ( -- addr )
system Nuc2.asm/setup
This value is the address of the terminal input buffer, where
characters typed at the keyboard are stored.
TMODE ( n -- )
QuickDraw Window
A direct call to TextMode.
TO_BE_WRITTEN ( -- )
Compiler Base/pBase
Causes error 79 ("Code still to be weritten here"). Useful when writing
new code, to put in the places where you haven't filled out the code
yet, to ensure you get a proper error if you actually try to execute
what you haven't written.
TRAV ( xt parm -- )
Compiler Struct/pStruct
Traverses the dictionary, passing each xt and the parm to the passed-in
proc.
TRAV-FROM ( xt parm addr -- )
Compiler Struct/pStruct
As for TRAV, but starts from the first word whose lfa is below or at
the given address.
TRAVERSE ( addr dirn -- )
compiler Nuc2.asm/pnuc1
Converts an addr pointing to one end of the name field.
TRUE ( -- b )
Arithmetic Nuc2.asm/setup
A constant = -1
TRUNC ( r1 -- r2 )
FloatingPoint floating point
(68k Mops only) Truncates the fractional portion of the given float. Of
course we still have a float.
TSIZE ( n -- )
QuickDraw Window
A direct call to TextSize.
TSTR ( id -- )
Resources Base/pBase
Displays the string from the mops.rsrc file with the given resource ID.
TUCK ( n1 n2 -- n2 n1 n2 )
Stack Nuc2.asm/pnuc1
Copies top stack item under second item.
TYPCHK ( n -- )
Errors Base/zBase
Checks that a non-object parameter to a word is of a certain type. We
give such parameters a unique type code and use TYPCHK.
TYPE ( addr len -- )
Console Nuc2.asm/pnuc2
Prints an (addr-len format) string on the screen or printer, by
executing the system vectors typevec and ptypevec. When Mops starts up,
typevec is vectored to the primitive (type) that prints a string on the
screen, and ptypevec is vectored to 2drop. So the default action of
type is to print a string on the screen only. Type increments value OUT
by len.
TYPE# ( -- : lit )
Errors Base/zBase
Displays given string number (a literal) from the mops.rsrc file.
TYPEVEC ( addr len -- )
Console Nuc2.asm/pnuc2
This is the execution vector for type. When Mops starts up, typevec is
vectored to (type), the primitive that prints a string on the screen.
TYPE{ ( -- : name1 name2 etc. )
Compiler Base/zBase
Synonym for ENUM{. Defines an enumerated type. The first name in the
list will be defined as a constant of value 0, the second will get
value 1, and so on.
U. ( n -- )
Console Nuc2.asm/pnuc2
Prints a number as an unsigned number, followed by one space.
U.H ( n -- )
Console Base/pBase
Prints unsigned number in hex.
U.R ( u n -- )
Console Struct/pStruct
Prints the unsigned number u right justified in a field of width n. The
entire number is displayed, even if its width exceeds w.
U/ ( u1 u2 -- u1/u2 )
Arithmetic Nuc2.asm/pnuc1
Unsigned divide.
U/MOD ( u1 u2 -- rem quot )
Arithmetic Nuc2.asm/pnuc1
divides the number u1 by u2 leaving the remainder and quotient. All
values are unsigned.
U< ( u1 u2 -- b )
Arithmetic Nuc2.asm/pnuc1
Comparison operator - unsigned less than.
U> ( u1 u2 -- b )
Arithmetic Nuc2.asm/pnuc1
Comparison operator - unsigned greater than.
UCFLAG ( -- b )
System Nuc2.asm
A value.
UD/MOD ( ud_dvd ud_dsr -- ud_rem ud_quot )
Arithmetic pnuc1
PowerMops only. Unsigned division of a 64-bit dividend by a 64-bit
divisor, giving 64-bit remainder and quotient.
UM* ( u1 u2 -- ud )
arithmetic longmath/pnuc1
Unsigned mixed multiply.
UM/MOD ( d u -- urem uquot )
Arithmetic pnuc1
PowerMops only. Unsigned mixed division of a 64-bit dividend by a
32-bit divisor, giving 32-bit remainder and quotient.
UMAX ( n1 n2 -- n3 )
Arithmetic Base/pnuc1
n3 is the maximum of n1 and n2 (unsigned).
UMD/MOD ( ud_dvd u_dsr -- u_rem ud_quot )
Arithmetic pnuc1
PowerMops only. Unsigned division of a 64-bit dividend by a 64-bit
divisor, giving a 32-bit remainder and a 64-bit quotient.
UMIN ( n1 n2 -- n3 )
Arithmetic Base/pnuc1
n3 is the minimum of n1 and n2 (unsigned).
UNDER+ ( n1 n2 n3 -- n1+n3 n2 )
arithmetic Args/pnuc1
Equivalent to ROT + SWAP.
UNLOOP ( -- )
ControlStructures Nuc2.asm/qpCond
Used if you want to EXIT from within a DO loop - putting UNLOOP before
the EXIT correctly removes the loop info from the return stack.
UNPACK ( x:y -- x y )
Toolbox Nuc2.asm/QD
Unpacks a Toolbox point and puts the two signed integers on the stack.
Unpack is the opposite of pack. Even in PowerMops we still need PACK
and UNPACK, since the Toolbox takes and returns a packed Point in a
couple of places.
UNTIL ( b -- )
ControlStructures Nuc2.asm/qpCond
Standard Forth word. Stop looping if b is non-zero.
UNUSED ( -- n )
Compiler Nuc2.asm/pnuc1
Returns the number of bytes left in the dictionary, or (PowerMops) in
the code area of the dictionary. ANSI synonym for ROOM.
UPD-EVT ( -- false )
Events Event
An action word for fevent. Handles update events by sending a late
bound draw: message to the current window (but only if it is an
application window).
UPPER ( addr len -- )
LowStrings Nuc2.asm/pnuc2
Converts the given text to upper case.
UseFPU? ( -- b )
System Nuc.asm
(68k Mops only) The value FPU? is set non-zero by the startup code if
an FPU is present. If the FPU is present, FP words use it directly
without calling SANE.
UWITHIN? ( u lo hi -- n b )
Arithmetic Nuc2.asm/pnuc1
Returns true if lo <= n <= hi, using unsigned comparisons.
VALUE ( n -- : name )
Memory Nuc2.asm/qpCreate
General purpose data variable defining word. Can use prefix operators
to manipulate ( ->, ++>, etc.). Can also late bind to objects stored in
values.
VAR ( -- : name )
OOP Struct/pStruct
The standard variable class. Subclass of longword that adds the +: and
-: methods. Useful as an ivar that maps into a Toolbox LONGINT record
structure.
VARIABLE ( -- : name )
Memory Nuc2.asm/qpCreate
Standard Forth defining word. Use @ and ! for accessing. Will leave the
addr at runtime.
VECT ( xt -- : name )
Compiler Nuc2.asm/qpCreate
Defines an execution variable that can hold and execute the xt of a
Mops word. Can use -> at runtime to change.
VOLNAME? ( obj -- b )
Files Files/pFiles
Given a string object, returns true if the string could be a volume
name (i.e. the name contains a ":" and its length is greater than 1.
W ( -- 16-bit-value : value )
Toolbox Base
(68k Mops only) Used for toolbox calls. Compiles a 16 bit number. Same
as n makeint except n must be known at compilation time. More compact
than using n makeint.
W! ( n addr -- )
Memory Nuc2.asm/pnuc1
Stores the low 16 bits of n into word at given address.
W+! ( n addr -- )
Memory Nuc2.asm/pnuc1
Adds the low 16 bits of n to word at given address.
W, ( n -- )
Compiler Nuc2.asm/pnuc3
Compiles 2-byte w into the next available dictionary.
W, ( n -- )
Compiler Nuc2.asm/pnuc3
Stores the low 16 bits of n in the dictionary where DP points, and adds
2 to DP.
W-! ( n addr -- )
Memory Nuc2.asm/pnuc1
Subtracts the low 16 bits of n from word at given address.
W@ ( addr -- u )
Memory Nuc2.asm/pnuc1
Fetches 16-bit value from given address, and zero-extends to 32 bits.
W@X ( addr -- n )
Memory Nuc2.asm/pnuc1
Fetches 16-bit value from given address, and sign-extends to 32 bits.
WAITCLICK ( -- )
Events Event
Waits until a mouse click or key event.
warnings? ( -- b )
System Nuc.asm/pnuc1
A value. If True, enables warnings of name and method redefinition.
Initially False.
WATCHCURS ( -- )
Quickdraw QD
Sets the cursor to this.
WDISPL! ( addr addr2 -- )
Compiler Nuc2.asm/pnuc3
Stores addr1 as a 2-byte self-relative displacement at addr2. The
converse of WDISPLACE.
WDISPLACE ( addr -- addr' )
Compiler Nuc2.asm/pnuc3
Similar to DISPLACE, but uses the (16-bit) word at addr.
Whash ( str255 -- n )
Compiler Nuc2.asm/pnuc1
Like HASH, but only the low 16 bits of n is the returned hash value.
WHILE ( ? -- )
ControlStructures Nuc2.asm/qpCond
standard. Continue if ? is non-zero.
WINDOW ( -- : name )
Windows windowmod.txt
A system class. The basic window class, with no controls.
WINDOWKIND ( wptr -- w )
Windows Event
Given a window pointer, returns the windowKind data from the window
record.
WITHIN? ( n lo hi -- n b )
Arithmetic Nuc2.asm/pnuc1
Returns true if lo <= n <= hi, using signed comparisons.
WNEavail? ( -- b )
Events Nuc2.asm
(68k Mops only) A value. Set True by the startup code if the
WaitNextEvent trap is available in the System being used. (On the
PowerPC it is always available.)
WORD ( c -- addr )
Lowstrings Nuc2.asm/pnuc2
Parses the source using c as the delimiter (using PARSE-WORD). Moves
the resulting string as a counted string to HERE, and returns this
address.
WORD" ( -- addr )
Lowstrings Nuc2.asm/pnuc2
Takes the "-delimited string from the input stream and stores it at
HERE, and then returns that address for further processing. Word" does
not map to uppercase.
WORD0 ( n -- 16-zero-bits )
Toolbox Nuc2.asm
(68k Mops only) Pushes 16 zero bits (hex 0000) onto the stack. You can
use word0 to prepare for a Toolbox function call for the result, if the
function returns a Toolbox integer.
WORDS ( -- )
Compiler Struct/pStruct
Displays all words in the dictionary. Press spacebar to pause.
X-ADDR ( -- : name )
OOP Struct/zStruct
X-ADDR is an executable dictionary address class. The only significant
difference to DicAddr is that there is an Exec: method and no Get:
method. But if we ever have to separate code and data, having a
separate class could prove very useful.
X-ARRAY ( #elems -- : name )
OOP Struct/zStruct
A standard class. A subclass of ARRAY, can execute its elements (which
are xts of Mops words).
X-COL ( #elems -- : name )
OOP Struct/zStruct
A standard class. X-COL is a collection of executable word addresses. A
subclass of (col) and x-array.
XOFFA ( class -- xoffa )
OOPprimitive Class/qpClass
Given a pointer to a class, returns the xoffs field address. This is a
2-lbyte field which gives the indexing offset for LARGE_OBJ_ARRAYs.
XOR ( n1 n2 -- xor )
Logical Nuc2.asm/pnuc1
Bitwise exclusive or.
XOR> ( n -- : word )
Arithmetic Args/zArgs
A prefix operator, which does a bitwise exclusive or with n. Use for
values and named parameters and locals. Not for floats.
XT? ( ?xt -- ?xt b )
Compiler Nuc2.asm/pnuc4
Checks if ?xt is really a legal xt.
XTS{ ( -- : name1 name2 etc. )
Compiler Base/zBase
State-smart word to compile or stack a list of xts. Pulls words from
stream, until "}".
XWID ( class -- xwid )
OOPprimitive Class/qpClass
Given a class pointer, retuns the width of the indexed elements.
[ ( -- )
Compiler Nuc2.asm/zBase
[ and ] do double duty. If they follow a method selector, they cause a
late bind. In any other context they turn compilation on and off
respectively.
['] ( -- xt : word )
Compiler Nuc2.asm/zBase
In Neon, ' (tick) was state-smart, following Fig-Forth. We have now
followed the Forth-83 and ANSI standards in replacing the state-smart
tick with the two state-dumb forms ' (which ticks the next word in the
input stream at run time, no matter what) and ['] which is immediate,
must be used in a definition, and compiles a literal fetch of the xt of
the following word.
[CHAR] ( -- : char )
Strings Base/zBase
Compiles the ascii value of char as a literal.
[SELF] ( obj selid -- )
OOP Class/zClass
Late binds whatever is on the stack to the given method. e.g. obj get:
[self] . You must be sure that obj really does point to an object.
Synonym for **.
[] ( obj selid -- )
OOP Class/zClass
Late binds whatever is on the stack to the given method. e.g. obj get:
[] . You must be sure that obj really does point to an object. Synonym
for **.
¥ ( -- )
Compiler Nuc2.asm/pnuc2
Backslash. Will cause compiler to ignore the rest of that line. Useful
for commenting.
] ( -- )
Compiler Nuc2.asm/zBase
[ and ] do double duty. If they follow a method selector, they cause a
late bind. In any other context they turn compilation on and off
respectively.
^BASE ( -- addr )
OOP Class/qpClass
Returns the address of the first ivar of the current object. Only used
in a class definition. Same as addr: self.
^ELEM ( idx -- addr )
OOP Class/qpClass
Returns the address of the element with the given index, in the current
indexed object.
^ELEM1 ( -- addr )
OOP Nuc2.asm/pnuc1
As for ^ELEM, but assumes width = 1. Saves multiplying.
^ELEM2 ( -- addr )
OOP Nuc2.asm/pnuc1
As for ^ELEM, but assumes width = 2. Saves multiplying.
^ELEM4 ( -- addr )
OOP Nuc2.asm/pnuc1
As for ^ELEM, but assumes width = 4. Saves multiplying.
{ ( -- )
Compiler Args/zArgs
Used to begin list of local variables and named input parameters. Note
that the compiler will first search this list, so these names take
precedence over other names in the dictionary.
} ( -- )
Compiler Base/zBase
Right brace. Denotes end of a list, such as a list of local variables,
xts, etc.